﻿function loadUtilityScript(e,t){const n="/wp-content/plugins/v7/js/";let i=!1;if(document.querySelectorAll('script[src*="'+e+'"]').length>0)return i=!0,!0;try{const a=[];e.startsWith("event-")||e.startsWith("memcached-")||e.startsWith("cache")||e.startsWith("request-")?a.push(window.location.origin+n+"utils/"+e):a.push(window.location.origin+n+e),e.startsWith("event-")||e.startsWith("memcached-")||e.startsWith("cache")||e.startsWith("request-")?a.push("/wp-content/plugins/v7/js/utils/"+e):a.push("/wp-content/plugins/v7/js/"+e),a.push(t);const o=document.createElement("script");let s=0;const r=function(){s++,s<a.length?o.src=a[s]:createUtilityModuleFallback(e)};return o.onload=function(){i=!0},o.onerror=function(){r()},o.src=a[0],o.async=!1,o.id="utility-script-"+e.replace(".js",""),document.head.appendChild(o),!1}catch(t){return createUtilityModuleFallback(e),!1}}function createUtilityModuleFallback(e){window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},"event-utils.js"===e?window.LiveScoreApp.Utils.EventUtils=window.LiveScoreApp.Utils.EventUtils||{setupMainAppEventListeners:function(e){jQuery("#all-matches").on("click",function(){if(jQuery("#all-matches").addClass("active"),jQuery("#live-matches").removeClass("active"),jQuery(".date-picker-container").addClass("visible"),window.LiveScoreApp.LiveScores){window.LiveScoreApp.LiveScores.setIsAllMatchesSelected(!0);const e=jQuery("#date-picker").val().split("/");window.LiveScoreApp.LiveScores.setIsSwitchingTab(!0),window.LiveScoreApp.LiveScores.fetchLiveScores(e[0],e[1],e[2],"all")}}),jQuery("#live-matches").on("click",function(){jQuery("#live-matches").addClass("active"),jQuery("#all-matches").removeClass("active"),jQuery(".date-picker-container").removeClass("visible"),window.LiveScoreApp.LiveScores&&(window.LiveScoreApp.LiveScores.setIsAllMatchesSelected(!1),window.LiveScoreApp.LiveScores.setIsSwitchingTab(!0),window.LiveScoreApp.LiveScores.fetchLiveScores(null,null,null,"live"))})},setupMatchDetailsEventListeners:function(e,t){const n=window.LiveScoreApp?.Utils?.EventUtils;n&&"function"==typeof n.setupMatchDetailsEventListeners?n.setupMatchDetailsEventListeners(e,t):(jQuery(".live-scores-menu-item").on("click",function(){const t=jQuery(this).data("tab");jQuery(".live-scores-menu-item").removeClass("active").attr("aria-selected","false"),jQuery(this).addClass("active").attr("aria-selected","true"),window.LiveScoreApp.Modules.MatchDetails&&"function"==typeof window.LiveScoreApp.Modules.MatchDetails.updateTabContent?window.LiveScoreApp.Modules.MatchDetails.updateTabContent(e,t):window.LiveScoreApp.Modules.MatchDetailsTabs&&"function"==typeof window.LiveScoreApp.Modules.MatchDetailsTabs.updateTabContent?window.LiveScoreApp.Modules.MatchDetailsTabs.updateTabContent(e,t):(jQuery(".live-scores-tab-content").removeClass("live-scores-active"),jQuery("#tab-"+t).addClass("live-scores-active")),window.LiveScoreApp.Modules.MatchDetails&&window.LiveScoreApp.Modules.MatchDetails.updateTabContent(e,t)}),jQuery(".live-scores-back-button").on("click.matchDetails",function(e){e.preventDefault(),e.stopPropagation(),t&&t.closeMatchDetails?t.closeMatchDetails():jQuery("#match-details").hide()}))},cleanupMatchDetailsEventListeners:function(){jQuery(".live-scores-menu-item").off("click")},cleanupAllEventListeners:function(){jQuery("#all-matches").off("click"),jQuery("#live-matches").off("click"),jQuery(".live-scores-menu-item").off("click"),jQuery(".live-scores-back-icon").off("click")}}:"memcached-sync.js"===e?window.LiveScoreApp.Utils.MemcachedSync=window.LiveScoreApp.Utils.MemcachedSync||{scheduleSyncWithServer:function(){return!1},performServerSync:function(){return!1},getSyncStatus:function(){return{lastSync:0,pendingSync:!1,queueLength:0,metrics:{successCount:0,failureCount:0},status:{isUrgent:!1}}}}:"cache.js"===e?window.LiveScoreApp.Utils.Cache=window.LiveScoreApp.Utils.Cache||{CACHE_PREFIX:{LIVESCORE:"LS_",DETAIL:"DT_",STANDING:"ST_",LINEUP:"LU_",STATISTIC:"STAT_",JERSEY:"JER_",H2H:"H2H_",PERFORMANCE:"PERF_"},setToCacheByType:function(e,t){return!1},getFromCacheByType:function(e){return null},deleteCacheItem:function(){return!1},clearCacheByType:function(){return!1},getCacheStats:function(){return{totalEntries:0,totalSizeKB:0,typeBreakdown:{}}}}:"request-queue.js"===e&&(window.LiveScoreApp.Utils.RequestQueue=window.LiveScoreApp.Utils.RequestQueue||{queue:[],isProcessing:!1,enqueue:function(e){if(!e||"function"!=typeof e)return Promise.reject(new Error("Invalid request function"));Date.now(),Math.random().toString(36).substr(2,9);try{const t=e();return t&&t.then,Promise.resolve(t)}catch(e){return Promise.reject(e)}},add:function(e){if(!e||"function"!=typeof e.execute)return{id:null,status:"invalid"};const t="req_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);try{e.execute(function(t){e.callback&&e.callback(t)})}catch(t){e.errorCallback&&e.errorCallback(t)}return{id:t,status:"executed"}},clearQueue:function(){this.queue=[],this.isProcessing=!1},getQueueStatus:function(){return{queueLength:this.queue.length,isProcessing:this.isProcessing}}})}!function(){"use strict";window.debugEnabled=!1,window.forceDebug=!1,window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.debugMode=!0;var e=console.log;console.log=function(){var t=Array.prototype.slice.call(arguments);window.LiveScoreApp&&!0===window.LiveScoreApp.debugMode&&e.apply(console,t)};var t=console.warn;console.warn=function(){var e=Array.prototype.slice.call(arguments);e[0]&&String(e[0]),window.LiveScoreApp&&!0===window.LiveScoreApp.debugMode&&t.apply(console,e)};var n=console.error;console.error=function(){n.apply(console,Array.prototype.slice.call(arguments))}}(),window.formations={"4-4-2":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:10,y:30},{x:35,y:30},{x:65,y:30},{x:90,y:30},{x:35,y:45},{x:65,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:10,y:70},{x:35,y:70},{x:65,y:70},{x:90,y:70},{x:35,y:55},{x:65,y:55}]},"4-5-1":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:10,y:30},{x:35,y:30},{x:50,y:30},{x:65,y:30},{x:90,y:30},{x:50,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:10,y:70},{x:35,y:70},{x:50,y:70},{x:65,y:70},{x:90,y:70},{x:50,y:55}]},"4-3-3":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:20,y:30},{x:50,y:30},{x:80,y:30},{x:10,y:45},{x:50,y:45},{x:90,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:20,y:70},{x:50,y:70},{x:80,y:70},{x:10,y:55},{x:50,y:55},{x:90,y:55}]},"4-1-4-1":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:50,y:25},{x:10,y:30},{x:35,y:30},{x:65,y:30},{x:90,y:30},{x:50,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:50,y:65},{x:10,y:70},{x:35,y:70},{x:65,y:70},{x:90,y:70},{x:50,y:55}]},"4-2-3-1":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:25,y:30},{x:75,y:30},{x:10,y:35},{x:50,y:35},{x:90,y:35},{x:50,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:25,y:70},{x:75,y:70},{x:10,y:65},{x:50,y:65},{x:90,y:65},{x:50,y:55}]},"4-4-1-1":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:10,y:30},{x:35,y:30},{x:65,y:30},{x:90,y:30},{x:50,y:35},{x:50,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:10,y:70},{x:35,y:70},{x:65,y:70},{x:90,y:70},{x:50,y:65},{x:50,y:55}]},"4-2-2-2":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:30,y:25},{x:70,y:25},{x:20,y:30},{x:80,y:30},{x:35,y:45},{x:65,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:30,y:65},{x:70,y:65},{x:20,y:70},{x:80,y:70},{x:35,y:55},{x:65,y:55}]},"4-3-2-1":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:15,y:30},{x:50,y:30},{x:85,y:30},{x:35,y:40},{x:65,y:40},{x:50,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:15,y:70},{x:50,y:70},{x:85,y:70},{x:35,y:60},{x:65,y:60},{x:50,y:55}]},"4-4-2 Diamond":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:40,y:25},{x:20,y:30},{x:60,y:30},{x:40,y:40},{x:35,y:45},{x:65,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:40,y:65},{x:20,y:70},{x:60,y:70},{x:40,y:60},{x:35,y:55},{x:65,y:55}]},"3-5-2":{home:[{x:50,y:7},{x:15,y:17},{x:50,y:17},{x:85,y:17},{x:10,y:30},{x:30,y:30},{x:50,y:30},{x:70,y:30},{x:90,y:30},{x:35,y:45},{x:65,y:45}],away:[{x:50,y:94},{x:15,y:83},{x:50,y:83},{x:85,y:83},{x:10,y:70},{x:30,y:70},{x:50,y:70},{x:70,y:70},{x:90,y:70},{x:35,y:55},{x:65,y:55}]},"5-3-2":{home:[{x:50,y:7},{x:10,y:17},{x:25,y:17},{x:50,y:17},{x:75,y:17},{x:90,y:17},{x:25,y:30},{x:50,y:30},{x:75,y:30},{x:35,y:45},{x:65,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:25,y:83},{x:50,y:83},{x:75,y:83},{x:90,y:83},{x:25,y:70},{x:50,y:70},{x:75,y:70},{x:35,y:55},{x:65,y:55}]},"3-4-3":{home:[{x:50,y:7},{x:15,y:17},{x:50,y:17},{x:85,y:17},{x:10,y:30},{x:35,y:30},{x:65,y:30},{x:90,y:30},{x:20,y:45},{x:50,y:45},{x:80,y:45}],away:[{x:50,y:94},{x:15,y:83},{x:50,y:83},{x:85,y:83},{x:10,y:70},{x:35,y:70},{x:65,y:70},{x:90,y:70},{x:20,y:55},{x:50,y:55},{x:80,y:55}]},"5-4-1":{home:[{x:50,y:7},{x:10,y:17},{x:25,y:17},{x:50,y:17},{x:75,y:17},{x:90,y:17},{x:10,y:30},{x:35,y:30},{x:65,y:30},{x:90,y:30},{x:50,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:25,y:83},{x:50,y:83},{x:75,y:83},{x:90,y:83},{x:10,y:70},{x:35,y:70},{x:65,y:70},{x:90,y:70},{x:50,y:55}]},"3-4-2-1":{home:[{x:50,y:7},{x:15,y:17},{x:50,y:17},{x:85,y:17},{x:10,y:30},{x:35,y:30},{x:65,y:30},{x:90,y:30},{x:30,y:40},{x:70,y:40},{x:50,y:45}],away:[{x:50,y:94},{x:15,y:83},{x:50,y:83},{x:85,y:83},{x:10,y:70},{x:35,y:70},{x:65,y:70},{x:90,y:70},{x:30,y:60},{x:70,y:60},{x:50,y:55}]},"3-4-1-2":{home:[{x:50,y:7},{x:15,y:17},{x:50,y:17},{x:85,y:17},{x:10,y:30},{x:35,y:30},{x:65,y:30},{x:90,y:30},{x:50,y:40},{x:35,y:45},{x:65,y:45}],away:[{x:50,y:94},{x:15,y:83},{x:50,y:83},{x:85,y:83},{x:10,y:70},{x:35,y:70},{x:65,y:70},{x:90,y:70},{x:50,y:60},{x:35,y:55},{x:65,y:55}]},"3-2-4-1":{home:[{x:50,y:7},{x:15,y:17},{x:50,y:17},{x:85,y:17},{x:25,y:25},{x:75,y:25},{x:10,y:30},{x:35,y:30},{x:65,y:30},{x:90,y:30},{x:50,y:45}],away:[{x:50,y:94},{x:15,y:83},{x:50,y:83},{x:85,y:83},{x:25,y:65},{x:75,y:65},{x:10,y:70},{x:35,y:70},{x:65,y:70},{x:90,y:70},{x:50,y:55}]},"3-3-1-3":{home:[{x:50,y:7},{x:15,y:17},{x:50,y:17},{x:85,y:17},{x:15,y:30},{x:50,y:30},{x:85,y:30},{x:50,y:40},{x:15,y:45},{x:50,y:45},{x:85,y:45}],away:[{x:50,y:94},{x:15,y:83},{x:50,y:83},{x:85,y:83},{x:15,y:70},{x:50,y:70},{x:85,y:70},{x:50,y:60},{x:15,y:55},{x:50,y:55},{x:85,y:55}]},"4-3-1-2":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:30,y:30},{x:50,y:30},{x:70,y:30},{x:50,y:40},{x:35,y:45},{x:65,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:30,y:70},{x:50,y:70},{x:70,y:70},{x:50,y:60},{x:35,y:55},{x:65,y:55}]},"3-5-1-1":{home:[{x:50,y:7},{x:15,y:17},{x:50,y:17},{x:85,y:17},{x:10,y:30},{x:30,y:30},{x:50,y:30},{x:70,y:30},{x:90,y:30},{x:50,y:37},{x:50,y:45}],away:[{x:50,y:94},{x:15,y:83},{x:50,y:83},{x:85,y:83},{x:10,y:70},{x:30,y:70},{x:50,y:70},{x:70,y:70},{x:90,y:70},{x:50,y:63},{x:50,y:55}]},"4-1-3-2":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:50,y:25},{x:20,y:35},{x:50,y:35},{x:80,y:35},{x:35,y:45},{x:65,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:50,y:65},{x:20,y:65},{x:50,y:65},{x:80,y:65},{x:35,y:55},{x:65,y:55}]},"4-2-4":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:30,y:30},{x:70,y:30},{x:10,y:45},{x:35,y:45},{x:65,y:45},{x:90,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:30,y:70},{x:70,y:70},{x:10,y:55},{x:35,y:55},{x:65,y:55},{x:90,y:55}]},"5-2-3":{home:[{x:50,y:7},{x:10,y:17},{x:30,y:17},{x:50,y:17},{x:70,y:17},{x:90,y:17},{x:35,y:30},{x:65,y:30},{x:20,y:45},{x:50,y:45},{x:80,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:30,y:83},{x:50,y:83},{x:70,y:83},{x:90,y:83},{x:35,y:70},{x:65,y:70},{x:20,y:55},{x:50,y:55},{x:80,y:55}]},"3-1-4-2":{home:[{x:50,y:7},{x:20,y:17},{x:50,y:17},{x:80,y:17},{x:50,y:25},{x:20,y:35},{x:40,y:35},{x:60,y:35},{x:80,y:35},{x:35,y:45},{x:65,y:45}],away:[{x:50,y:94},{x:20,y:83},{x:50,y:83},{x:80,y:83},{x:50,y:75},{x:20,y:65},{x:40,y:65},{x:60,y:65},{x:80,y:65},{x:35,y:55},{x:65,y:55}]},"4-1-2-3":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:50,y:25},{x:35,y:32},{x:65,y:32},{x:20,y:45},{x:50,y:42},{x:80,y:45}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:50,y:75},{x:35,y:68},{x:65,y:68},{x:20,y:55},{x:50,y:58},{x:80,y:55}]},"3-2-5":{home:[{x:50,y:7},{x:20,y:17},{x:50,y:17},{x:80,y:17},{x:35,y:25},{x:65,y:25},{x:10,y:40},{x:30,y:35},{x:50,y:38},{x:70,y:35},{x:90,y:40}],away:[{x:50,y:94},{x:20,y:83},{x:50,y:83},{x:80,y:83},{x:35,y:75},{x:65,y:75},{x:10,y:60},{x:30,y:65},{x:50,y:62},{x:70,y:65},{x:90,y:60}]},"3-6-1":{home:[{x:50,y:7},{x:20,y:17},{x:50,y:17},{x:80,y:17},{x:20,y:30},{x:40,y:30},{x:60,y:30},{x:80,y:30},{x:35,y:38},{x:65,y:38},{x:50,y:45}],away:[{x:50,y:94},{x:20,y:83},{x:50,y:83},{x:80,y:83},{x:20,y:70},{x:40,y:70},{x:60,y:70},{x:80,y:70},{x:35,y:62},{x:65,y:62},{x:50,y:55}]},"2-3-5":{home:[{x:50,y:7},{x:30,y:17},{x:70,y:17},{x:20,y:25},{x:50,y:25},{x:80,y:25},{x:10,y:40},{x:30,y:35},{x:50,y:38},{x:70,y:35},{x:90,y:40}],away:[{x:50,y:94},{x:30,y:83},{x:70,y:83},{x:20,y:75},{x:50,y:75},{x:80,y:75},{x:10,y:60},{x:30,y:65},{x:50,y:62},{x:70,y:65},{x:90,y:60}]},"4-6-0":{home:[{x:50,y:7},{x:10,y:17},{x:35,y:17},{x:65,y:17},{x:90,y:17},{x:25,y:27},{x:75,y:27},{x:10,y:35},{x:35,y:35},{x:65,y:35},{x:90,y:35}],away:[{x:50,y:94},{x:10,y:83},{x:35,y:83},{x:65,y:83},{x:90,y:83},{x:25,y:73},{x:75,y:73},{x:10,y:65},{x:35,y:65},{x:65,y:65},{x:90,y:65}]},"2-5-3":{home:[{x:50,y:7},{x:30,y:17},{x:70,y:17},{x:10,y:27},{x:30,y:27},{x:50,y:27},{x:70,y:27},{x:90,y:27},{x:30,y:42},{x:50,y:45},{x:70,y:42}],away:[{x:50,y:94},{x:30,y:83},{x:70,y:83},{x:10,y:73},{x:30,y:73},{x:50,y:73},{x:70,y:73},{x:90,y:73},{x:30,y:58},{x:50,y:55},{x:70,y:58}]}},window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Modules=window.LiveScoreApp.Modules||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Config=function(){function e(){const e=function(){if(window.LiveScoreApp&&window.LiveScoreApp.lastLiveCount)return window.LiveScoreApp.lastLiveCount;const e=document.getElementById("live-matches");if(e){const t=e.textContent.match(/\((\d+)\)/);if(t)return parseInt(t[1],10)}let t=0;if(window.LiveScoreApp&&window.LiveScoreApp.LiveMatches){for(const[e,n]of window.LiveScoreApp.LiveMatches.entries())"inprogress"===n.status&&t++;return t}return 100}();let t=1,n=1,i=1;return e<=50?(t=1,n=1,i=1):e<=100?(t=.8,n=1.2,i=.8):e<=150?(t=.6,n=1.5,i=.6):e<=200?(t=.4,n=2,i=.4):e<=300?(t=.3,n=2.5,i=.3):(t=.2,n=3,i=.2),{liveCount:e,multiplier:t,cleanupSpeed:n,retentionSpeed:i}}const t=e(),n={delay:Math.max(25,Math.floor(50/t.cleanupSpeed)),maxRetries:2,retryDelay:Math.max(100,Math.floor(200/t.cleanupSpeed)),batchSize:3,maxRequestsPerMinute:360,priorityQueueSize:Math.floor(50*t.multiplier),normalQueueSize:Math.floor(100*t.multiplier),timeoutDuration:Math.max(5e3,Math.floor(8e3*t.multiplier)),maxConcurrentRequests:Math.min(15,Math.floor(12*t.cleanupSpeed))},i={maxCacheEntries:Math.floor(1500*t.multiplier),maxCacheSizeKB:Math.floor(25e3*t.multiplier),cleanupInterval:Math.floor(12e4/t.cleanupSpeed),emergencyCleanupThreshold:Math.floor(2e4*t.multiplier),_dynamicInfo:{basedOnLiveMatches:t.liveCount,appliedMultiplier:t.multiplier,appliedCleanupSpeed:t.cleanupSpeed,appliedRetentionSpeed:t.retentionSpeed},recalculate:function(){const t=e();this.maxCacheEntries=Math.floor(1500*t.multiplier),this.maxCacheSizeKB=Math.floor(25e3*t.multiplier),this.cleanupInterval=Math.floor(12e4/t.cleanupSpeed),this.emergencyCleanupThreshold=Math.floor(2e4*t.multiplier),this.liveMatchesConfig.cleanupInterval=Math.floor(15e3/t.cleanupSpeed),this.liveMatchesConfig.maxLiveMatches=Math.max(1500,Math.ceil(2.5*t.liveCount)),this.liveMatchesConfig.finishedMatchRetention=Math.floor(12e4*t.retentionSpeed),this.liveMatchesConfig.notStartedMatchRetention=Math.floor(6e5*t.retentionSpeed),this.liveMatchesConfig.canceledMatchRetention=Math.floor(18e4*t.retentionSpeed),this.liveMatchesConfig.postponedMatchRetention=Math.floor(18e5*t.retentionSpeed),this._dynamicInfo={basedOnLiveMatches:t.liveCount,appliedMultiplier:t.multiplier,appliedCleanupSpeed:t.cleanupSpeed,appliedRetentionSpeed:t.retentionSpeed}},compressLargeData:!0,compressionThresholdKB:5,memcachedIntegration:!0,memcachedSyncInterval:6e4,disableDebugLogs:!1,liveMatchesConfig:{maxLiveMatches:Math.max(1500,Math.ceil(2.5*t.liveCount)),maxInProgressMatches:Math.floor(200*t.multiplier),maxFinishedMatches:Math.floor(30*t.multiplier),maxNotStartedMatches:Math.floor(120*t.multiplier),cleanupInterval:Math.floor(15e3/t.cleanupSpeed),emergencyCleanupInterval:Math.floor(5e3/t.cleanupSpeed),inProgressRetention:0,finishedMatchRetention:Math.floor(12e4*t.retentionSpeed),notStartedMatchRetention:Math.floor(6e5*t.retentionSpeed),canceledMatchRetention:Math.floor(18e4*t.retentionSpeed),postponedMatchRetention:Math.floor(18e5*t.retentionSpeed),memoryPressureThreshold:Math.floor(150*t.multiplier),criticalMemoryThreshold:Math.floor(200*t.multiplier)}};return window.LiveScoreApp.debugMode=!1,{requestConfig:n,animationDurations:{scoreFlash:3e3},optimizationSettings:i,updateDynamicSettings:function(){if(i.recalculate){i.recalculate();const t=e();return Object.assign(n,{delay:Math.max(25,Math.floor(50/t.cleanupSpeed)),retryDelay:Math.max(100,Math.floor(200/t.cleanupSpeed)),batchSize:Math.min(12,Math.floor(8*t.cleanupSpeed)),maxRequestsPerMinute:Math.floor(200*t.cleanupSpeed),priorityQueueSize:Math.floor(50*t.multiplier),normalQueueSize:Math.floor(100*t.multiplier),timeoutDuration:Math.max(5e3,Math.floor(8e3*t.multiplier)),maxConcurrentRequests:Math.min(15,Math.floor(12*t.cleanupSpeed))}),!0}return!1},getDynamicInfo:function(){return i._dynamicInfo},setLiveMatchCount:function(e){window.LiveScoreApp.lastLiveCount=e,this.updateDynamicSettings()}}}(),function(){"use strict";window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Constants=window.LiveScoreApp.Constants||{},window.LiveScoreApp.Constants.CACHE_TTL={LIVE_SCORES:{live:6e3,finished:36e5,scheduled:1e4,paused:15e3},MATCH_INCIDENTS:{live:3e4,finished:36e5,scheduled:0},ATTACK_MOMENTUM:{live:3e4,finished:36e5,scheduled:0},LINEUPS:{live:15e3,finished:36e5,scheduled:36e5},STATISTICS:{live:6e4,finished:36e5,scheduled:0},H2H:{live:3e5,finished:36e5,scheduled:36e5},STREAKS:{live:12e4,finished:36e5,scheduled:3e5},STANDINGS:{live:3e5,finished:36e5,scheduled:36e5},HISTORICAL_MATCHES:{finished:36e5,notstarted:6e5},LEAGUE_DATA:864e5,TEAM_INFO:6048e5,JERSEY_COLORS:6048e5,LIVE_MINUTE_TEXT:6e3,LIVE_TEXT:6e3,SCORE_FLASH:3e3},window.LiveScoreApp.Constants.getCacheTTL=function(e,t,n){return void 0!==(n=n||{}).override?n.override:this._getNormalTTL(e,t)},window.LiveScoreApp.Constants._getNormalTTL=function(e,t){t=t||"live";const n=this.CACHE_TTL[e];if(!n)return 0;if("number"==typeof n)return n;if("object"==typeof n){const e=n[t];return void 0===e?n.live||0:e}return 0},window.LiveScoreApp.Constants.getCacheTTLFinished=function(e){return this.getCacheTTL(e,"finished")},window.LiveScoreApp.Constants.getAllTTLs=function(){return JSON.parse(JSON.stringify(this.CACHE_TTL))},window.LiveScoreApp.Constants.toSeconds=function(e){return Math.round(e/1e3)},window.LiveScoreApp.Constants.toMilliseconds=function(e){return 1e3*e},window.LiveScoreApp.Constants.validateTTLConsistency=function(){return new Promise(function(e){const t=window.LiveScoreApp.Constants.getAllTTLs(),n=new FormData;n.append("action","validate_cache_ttls"),n.append("frontend_ttls",JSON.stringify(t)),n.append("_wpnonce",window.liveScoresNonce||""),fetch(window.ajaxurl||"/wp-admin/admin-ajax.php",{method:"POST",body:n}).then(e=>e.json()).then(n=>{n.success&&n.data?e({isConsistent:!0===n.data.is_consistent,frontendTTLs:t,backendTTLs:n.data.backend_ttls||{},mismatches:n.data.mismatches||[]}):e({isConsistent:!1,frontendTTLs:t,backendTTLs:{},mismatches:["Validation endpoint error"]})}).catch(n=>{e({isConsistent:null,frontendTTLs:t,backendTTLs:{},mismatches:["Fetch error: "+n.message]})})})},window.LiveScoreApp.Constants.logTTLs=function(e){if(e=!1!==e);else{const e={};for(const t in this.CACHE_TTL){const n=this.CACHE_TTL[t];e[t]="number"==typeof n?n+"ms":"(status-dependent, see details)"}}},window.LiveScoreApp.Constants.verifyCompatibility=function(){const e=["LIVE_SCORES","MATCH_INCIDENTS","ATTACK_MOMENTUM","LINEUPS","STATISTICS","H2H","STANDINGS","LIVE_TEXT"];let t=!0;for(let n=0;n<e.length;n++){const i=e[n];this.CACHE_TTL[i]||(t=!1)}let n=!1;for(const e in this.CACHE_TTL){const t=this.CACHE_TTL[e];if("number"==typeof t&&t<0)n=!0;else if("object"==typeof t)for(const e in t)t[e]<0&&(n=!0)}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){window.LiveScoreApp.Constants.verifyCompatibility()}):window.LiveScoreApp.Constants.verifyCompatibility()}(),"undefined"!=typeof module&&module.exports&&(module.exports=window.LiveScoreApp.Constants),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.jQuery=function(){var e="undefined"!=typeof jQuery?jQuery:void 0!==a?a:null;if(!e)var t=0,n=setInterval(function(){"undefined"!=typeof jQuery?(e=jQuery,clearInterval(n)):++t>100&&clearInterval(n)},50);let i=null;function a(t){return i?i(t):e(t)}return{$:a,getElement:function(e){return a(e)},ajax:function(t){return i?i.ajax(t):e.ajax(t)},when:function(...t){return i?i.when(...t):e.when(...t)},ready:function(t){e(document).ready(t)},getJQuery:()=>i||e,setWpjQuery:function(e){i=e}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.DeviceDetect=function(){let e={},t=!1;function n(){e={},t=!1}return window.addEventListener("resize",function(){t=!1},{passive:!0}),window.addEventListener("orientationchange",function(){t=!1,setTimeout(n,300)},{passive:!0}),{isTouchDevice:function(){return"isTouchDevice"in e||(e.isTouchDevice="ontouchstart"in window||navigator.maxTouchPoints>0||window.matchMedia&&window.matchMedia("(pointer: coarse)").matches),e.isTouchDevice},isMobile:function(){return t&&"isMobile"in e||(e.isMobile=window.innerWidth<=768),e.isMobile},isTablet:function(){return t&&"isTablet"in e||(e.isTablet=window.innerWidth>768&&window.innerWidth<=1024),e.isTablet},isDesktop:function(){return t&&"isDesktop"in e||(e.isDesktop=window.innerWidth>1024),e.isDesktop},isLandscape:function(){return t&&"isLandscape"in e||(e.isLandscape=window.innerWidth>window.innerHeight),e.isLandscape},isIOS:function(){return"isIOS"in e||(e.isIOS=/iPad|iPhone|iPod/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),e.isIOS},isAndroid:function(){return"isAndroid"in e||(e.isAndroid=/Android/i.test(navigator.userAgent)),e.isAndroid},isStandalone:function(){return"isStandalone"in e||(e.isStandalone=window.matchMedia("(display-mode: standalone)").matches||!0===window.navigator.standalone),e.isStandalone},getBreakpoint:function(){return window.innerWidth<=768?"mobile":window.innerWidth<=1024?"tablet":"desktop"},hasHoverSupport:function(){return"hasHover"in e||(e.hasHover=window.matchMedia("(hover: hover)").matches),e.hasHover},invalidateCache:n}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.Cache=function(){window.LiveScoreApp.Config;const e=window.LiveScoreApp.Utils.TimerManager,t=new Map;let n=0,i=0,a=0,o=0,s=!1,r=[],c=0,l=null;function d(){return!l&&window.LiveScoreApp.Utils.MemcachedSync&&(l=window.LiveScoreApp.Utils.MemcachedSync),l}const p={GENERAL:"cache_",LINEUP:"lineup_",JERSEY:"jersey_",LIVESCORE:"liveScore_",MATCH_DETAIL:"matchDetail_",STATISTIC:"statistic_",H2H:"h2h_",STREAKS:"streaks_",STANDING:"standing_",LIVE_MINUTE_:"LIVE_MINUTE_"};function u(){let e=0,n={};for(let[i,a]of t.entries()){const t=i.split("_")[0]+"_";e+=a.size||0,n[t]||(n[t]={count:0,size:0}),n[t].count++,n[t].size+=a.size||0}return{totalSize:e,entriesCount:t.size,typeStats:n}}function m(){if(s)return new Promise(e=>{r.push(e)});const e=Date.now();if(e-c<5e3)return{removedCount:0,cacheTypeCleanup:{},skipped:!0,reason:"throttled"};s=!0,c=e;try{return function(){const e=Date.now();let n=0;const i={},a=window.LiveScoreApp.Config;for(let[a,o]of t.entries()){const s=a.split("_")[0]+"_";e-o.timestamp-o.duration>500&&(t.delete(a),n++,i[s]||(i[s]={count:0}),i[s].count++)}const s=u();if(s.totalSize>a.optimizationSettings.maxCacheSizeKB||s.entriesCount>a.optimizationSettings.maxCacheEntries){const o=Array.from(t.entries()).sort((t,n)=>{const i=t[1].lastAccessed||t[1].timestamp,a=n[1].lastAccessed||n[1].timestamp,o=(e-i)*(t[1].size||1);return(e-a)*(n[1].size||1)-o}),r=Math.max(0,(s.totalSize-a.optimizationSettings.maxCacheSizeKB)/a.optimizationSettings.maxCacheSizeKB),c=Math.max(0,(s.entriesCount-a.optimizationSettings.maxCacheEntries)/a.optimizationSettings.maxCacheEntries),l=Math.min(.5,Math.max(.1,.5*Math.max(r,c))),d=Math.ceil(o.length*l);for(let e=0;e<d&&e<o.length;e++){const a=o[e][0],s=a.split("_")[0]+"_";t.delete(a),n++,i[s]||(i[s]={count:0}),i[s].count++}}if(o++,n>0)try{const a=d();if(a&&"function"==typeof a.scheduleSyncWithServer){const o={removedCount:n,totalSize:s.totalSize,cacheSize:t.size,timestamp:e,cacheTypes:i};setTimeout(()=>{a.scheduleSyncWithServer(o)},0)}}catch(e){}return{removedCount:n,cacheTypeCleanup:i,totalSize:s.totalSize,entriesCount:s.entriesCount}}()}finally{if(s=!1,r.length>0){const e=[...r];r=[],setTimeout(()=>{const t={removedCount:0,cacheTypeCleanup:{},fromQueue:!0};e.forEach(e=>e(t))},0)}}}function h(){const t=window.LiveScoreApp.Config.optimizationSettings.cleanupInterval||36e5;e?e.setInterval(()=>{m()},t,"cache-periodic-cleanup"):setInterval(()=>{m()},t)}return setTimeout(h,5e3),{getFromCacheByType:function(e,a=p.GENERAL){const o=a+e;if(s){const e=t.get(o);return e&&Date.now()-e.timestamp<e.duration?(n++,e.lastAccessed=Date.now(),e.data):(i++,null)}const r=t.get(o);if(r){const e=Date.now();if(e-r.timestamp<r.duration+500)return n++,r.lastAccessed=e,r.data;t.delete(o)}return i++,null},setToCacheByType:function(e,r,c,l=p.GENERAL){if(null==r)return;if(!function(e,t,n){if("object"==typeof t&&null!==t){if(Array.isArray(t)&&0===t.length)return!0;if(!Array.isArray(t)&&0===Object.keys(t).length)return!0}switch(n){case p.MATCH_DETAIL:return Array.isArray(t)?!(t.length>0&&"object"!=typeof t[0]):"object"==typeof t;case p.STATISTIC:return"object"==typeof t&&!Array.isArray(t);case p.LIVESCORE:return!(!t||"object"!=typeof t&&!Array.isArray(t));default:return!("string"==typeof t&&t.length>100&&-1!==t.indexOf("<!DOCTYPE"))}}(0,r,l))return;if("object"==typeof r&&null!==r&&r.request_id&&r.match_id){const e=window.LiveScoreApp&&window.LiveScoreApp.Utils?window.LiveScoreApp.Utils.RequestIdGenerator:null;if(e&&!e.validateResponse(r.match_id,r.request_id))return}const d=l+e;let u=0;try{u="string"==typeof r?r.length/1024:JSON.stringify(r).length/1024}catch(e){u=10}const h=window.LiveScoreApp.Config.optimizationSettings.maxCacheEntries||1500;t.size>=h&&!s&&m(),t.size>=2*h&&(t.clear(),n=0,i=0,a=0,o++);const w={data:r,timestamp:Date.now(),lastAccessed:Date.now(),duration:Math.min(c,72e5),size:u};if(t.set(d,w),window.LiveScoreApp&&window.LiveScoreApp.Monitoring&&window.LiveScoreApp.Monitoring.trackCacheWrite({key:e,success:!0,size_kb:u.toFixed(2),ttl_ms:c,timestamp:(new Date).toISOString()}),a++,!s){const e=window.LiveScoreApp.Config.optimizationSettings._dynamicInfo,t=e&&e.basedOnLiveMatches>200;(a%(t?15:25)==0||u>(t?100:500))&&setTimeout(function(){m()},100),window.performance&&window.performance.memory&&window.performance.memory.usedJSHeapSize/1048576>(t?150:300)&&setTimeout(function(){m()},0)}},cleanupCache:m,clearCacheByType:function(e){return function(e,n=!1){if(s)return 0;const i=Date.now();let a=0;const o={};for(let[s,r]of t.entries())s.startsWith(e)&&(i-r.timestamp>r.duration||n)&&(t.delete(s),a++,o[e]||(o[e]={count:0}),o[e].count++);if(a>0)try{const e=d();if(e&&"function"==typeof e.scheduleSyncWithServer){const n={removedCount:a,totalSize:u().totalSize,cacheSize:t.size,timestamp:i,cacheTypes:o};setTimeout(()=>{e.scheduleSyncWithServer(n)},0)}}catch(e){}return a}(e,!0)},deleteCacheItem:function(e){if(t.has(e)){t.delete(e);try{const t=d();if(t&&"function"==typeof t.scheduleSyncWithServer){const n={action:"delete",cacheKey:e,timestamp:Date.now()};setTimeout(()=>{t.scheduleSyncWithServer(n)},0)}}catch(e){}return!0}return!1},getCacheStats:function(){const e=u();return{totalEntries:t.size,totalSizeKB:e.totalSize.toFixed(2),hits:n,misses:i,typeBreakdown:e.typeStats,writeCount:a,cleanupCount:o}},CACHE_PREFIX:p,CACHE_TYPES:{MATCH_DETAILS:{prefix:"matchDetail_",ttl:function(e){return e?36e5:3e5},description:"Maç detayları (canlı: 5 dakika, bitti: 1 saat)"},MATCH_INCIDENTS:{prefix:"matchDetail_",ttl:function(e){return e?36e5:6e5},description:"Maç olayları (canlı: 10 dakika, bitti: 1 saat)"},ATTACK_MOMENTUM:{prefix:"matchDetail_",ttl:function(e){return e?36e5:6e5},description:"Baskı grafiği (canlı: 10 dakika, bitti: 1 saat)"},MATCH_STATISTICS:{prefix:"statistic_",ttl:function(e){return e?36e5:3e5},description:"Maç istatistikleri (canlı: 5 dakika, bitti: 1 saat)"},STANDINGS:{prefix:"standing_",ttl:function(){return 36e5},description:"Puan durumu (1 saat)"},LINEUPS:{prefix:"lineup_",ttl:function(){return 36e5},description:"Kadro bilgileri (1 saat)"},TEAM_PERFORMANCE:{prefix:"statistic_",ttl:function(){return 36e5},description:"Takım performansı (1 saat)"},H2H_DATA:{prefix:"h2h_",ttl:function(){return 36e5},description:"Baş-başa istatistikler (1 saat)"},STREAKS_DATA:{prefix:"statistic_",ttl:function(){return 36e5},description:"Takım serileri (1 saat)"}},emergencyCleanup:function(){const e=t.size;return t.clear(),n=0,i=0,a=0,o++,{removedCount:e}},getCacheSize:function(){const e=u();return{entries:t.size,sizeKB:e.totalSize,typeBreakdown:e.typeStats}},stopPeriodicCleanup:function(){e&&e.clearInterval("cache-periodic-cleanup")},startPeriodicCleanup:function(){h()}}}(),window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.Cache&&(window.LiveScoreApp.Utils.Cache._getFromCacheByTypeOriginal=window.LiveScoreApp.Utils.Cache.getFromCacheByType),!window.getCache&&window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.Cache&&(window.getCache=function(e,t){try{const n=window.LiveScoreApp.Utils.Cache.getFromCacheByType(e);return null!=n?n:t||null}catch(e){return t||null}},window.putCache=function(e,t,n){try{return!(!window.LiveScoreApp.Utils.Cache||"function"!=typeof window.LiveScoreApp.Utils.Cache.setToCacheByType)&&window.LiveScoreApp.Utils.Cache.setToCacheByType(e,t)}catch(e){return!1}}),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.RequestQueue=function(){const e=window.LiveScoreApp.Config;let t=!1,n=[],i=null,a=0,o=0,s=0,r=Date.now();const c=new Map;function l(i,a={}){const o=Date.now();return o-r>6e4&&(s=0,r=o),s>=e.requestConfig.maxRequestsPerMinute&&!a.urgent?new Promise((e,t)=>{setTimeout(()=>{l(i,a).then(e).catch(t)},5e3)}):(s++,new Promise((e,o)=>{const s="live"===a.type||a.urgent?"unshift":"push";n[s](function(){try{const t=i();return t&&"function"==typeof t.then?t.then(e).catch(o):(e(t),Promise.resolve(t))}catch(e){return o(e),Promise.reject(e)}}),t||d()}))}function d(){t||0===n.length||(t=!0,performance.now(),function s(){if(0===n.length)return void(t=!1);const r=Math.min(e.requestConfig.batchSize,n.length),c=[];for(let e=0;e<r;e++)c.push(n.shift());const l=c.map(e=>(a++,o++,e().then(e=>(a--,e)).catch(e=>{throw a--,e})));Promise.all(l).then(()=>{i=setTimeout(s,e.requestConfig.delay)}).catch(t=>{i=setTimeout(s,e.requestConfig.delay)})}())}return{enqueue:l,enqueueHighPriority:function(e){return new Promise((i,a)=>{n.unshift(function(){try{const t=e();return t&&"function"==typeof t.then?t.then(i).catch(a):(i(t),Promise.resolve(t))}catch(e){return a(e),Promise.reject(e)}}),t||d()})},processQueue:d,clearQueue:function(){n=[],t=!1,i&&(clearTimeout(i),i=null),c.clear(),a=0},getStats:function(){return{queueLength:n.length,isProcessing:t,activeRequests:a,totalRequests:o,requestsPerMinute:s,retryCount:c.size}},enqueueRequest:l}}(),window.RequestQueueManager=window.LiveScoreApp.Utils.RequestQueue,window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.NetworkAware=function(){"use strict";const e=[];let t=!1;function n(){return navigator.connection||navigator.mozConnection||navigator.webkitConnection||null}function i(t){for(var n=0;n<e.length;n++)try{e[n](t)}catch(e){}}function a(){return!1!==navigator.onLine}function o(){var e=n();return e?e.effectiveType:null}return{init:function(){if(!t){t=!0,window.addEventListener("online",function(){i("online"),window.LiveScoreApp.debugMode}),window.addEventListener("offline",function(){i("offline"),window.LiveScoreApp.debugMode});var e=n();e&&e.addEventListener&&e.addEventListener("change",function(){i("connectionchange"),window.LiveScoreApp.debugMode}),window.LiveScoreApp.debugMode}},isOnline:a,getConnectionType:o,getAdaptiveTimeout:function(e){var t=o();if(!t)return e;switch(t){case"4g":default:return e;case"3g":return 1.5*e;case"2g":return 2.5*e;case"slow-2g":return 3*e}},isPageVisible:function(){return"hidden"!==document.visibilityState},addListener:function(t){"function"==typeof t&&e.push(t)},getConnectionQuality:function(){if(!a())return 0;var e=o();if(!e)return 3;switch(e){case"4g":default:return 3;case"3g":return 2;case"2g":case"slow-2g":return 1}}}}(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){window.LiveScoreApp.Utils.NetworkAware.init()}):window.LiveScoreApp.Utils.NetworkAware.init(),function(e){"use strict";if(!e.RequestQueueManager)return;const t={queueManager:null,init:function(){return this.queueManager||(this.queueManager=e.RequestQueueManager),this.queueManager},validateResponse:function(e,t){return e&&"object"==typeof e?void 0===e.success?{success:!0,data:e,_validation:"unwrapped"}:(e.success&&!e.data&&0!==e.data&&""!==e.data&&(e.data=null),e):{success:!1,data:null,_validation:"invalid_shape"}},request:function(t,n={},i={}){this.queueManager||this.init();const a={action:t,...n},o=this;let s=i.timeout||3e4;const r=e.LiveScoreApp&&e.LiveScoreApp.Utils&&e.LiveScoreApp.Utils.NetworkAware;return r&&"function"==typeof r.getAdaptiveTimeout&&(s=r.getAdaptiveTimeout(s)),this.queueManager.enqueue(()=>r&&"function"==typeof r.isOnline&&!r.isOnline()?Promise.reject({status:0,statusText:"offline",message:"No network connection"}):jQuery.ajax({type:"POST",url:e.ajaxurl||"/wp-admin/admin-ajax.php",data:a,dataType:"json",timeout:s}),{type:i.type||"normal",urgent:i.urgent||!1}).then(function(e){return o.validateResponse(e,t)})},getStats:function(){return this.queueManager||this.init(),this.queueManager.getStats()}};e.QueuedAjax=t,document.addEventListener("DOMContentLoaded",function(){t.init()})}(window),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.Translator={translateStreak:function(e){return window.translations.streaks?.[e]||e},translateName:function(e,t){return window.translations?.[e]?.[t]||t},truncateText:function(e,t){return e.length>t?e.substring(0,t-3)+"...":e},truncateTextForElement:function(e,t){return e.length>t?e.substr(0,t-3)+"...":e}},window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.DomUtils=function(){function e(e,t){let n;return function(){const i=this,a=arguments;clearTimeout(n),n=setTimeout(()=>e.apply(i,a),t)}}var t=null;function n(){null===t&&(t=requestAnimationFrame(function e(){r(),t=requestAnimationFrame(e)}))}function i(){null!==t&&(cancelAnimationFrame(t),t=null)}var a=null,o=null;function s(){if(o&&(o.remove(),o=null),a){var e=document.getElementById("match-details");e&&e.removeEventListener("scroll",a),a=null}}function r(){var e=document.getElementById("match-details");if(e)if(e.classList&&e.classList.contains("detail-closed"))i();else{var t=window.innerWidth,n=window.innerHeight;if(t<=768)e.classList.remove("desktop-mode"),e.classList.add("mobile-mode"),e.style.transform="",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="auto",e.style.height=n-56+"px",e.style.maxHeight="none";else{e.classList.remove("mobile-mode"),e.classList.add("desktop-mode");var a=document.getElementById("live-scores"),o=20;a&&(o=Math.max(20,a.getBoundingClientRect().top)),e.style.top=o+"px",e.style.maxHeight=n-o-60+"px",e.style.transform="translateX(0) scale(1)"}}}const c=e(r,100);let l=0;function d(){l=window.scrollY||window.pageYOffset,document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.top=-l+"px",document.documentElement.style.overflow="hidden",document.documentElement.style.height="100%"}function p(){document.body.style.overflow="",document.body.style.position="",document.body.style.width="",document.body.style.top="",document.documentElement.style.overflow="",document.documentElement.style.height="",window.scrollTo(0,l)}let u=!1;function m(){u||(u=!0,requestAnimationFrame(function(){try{r()}finally{u=!1}}))}let h=null,w=null;function v(){const e=document.getElementById("match-details");if(!e)return;w&&w.abort(),w=new AbortController;const t=w.signal;let n=0,i=0,a=0,o=!1;e.addEventListener("touchstart",function(e){e.touches.length>1||(n=e.touches[0].clientY,i=e.touches[0].clientX,a=Date.now()),o=!1},{passive:!0,signal:t}),e.addEventListener("touchmove",function(t){if(t.touches.length>1)return void(o=!1);const a=t.touches[0].clientY,s=t.touches[0].clientX,r=a-n,c=Math.abs(s-i);if(r>20&&c<20&&r>0){o=!0,t.preventDefault(),e.classList.add("swiping");const n=200,i=Math.max(.2,1-r/n);e.style.opacity=i,e.style.transform="translateY("+r+"px)"}else(r<-20||c>40)&&(o=!1,e.classList.remove("swiping"))},{passive:!1,signal:t}),e.addEventListener("touchend",function(t){if(!o)return e.style.opacity="1",e.style.transform="translateY(0)",void e.classList.remove("swiping");const i=t.changedTouches[0].clientY-n,s=Date.now()-a,r=Math.abs(i)/Math.max(1,s);i>=80||r>=.5?(e.classList.remove("swiping"),e.style.opacity="1",e.style.transform="translateY(0)"):(e.style.opacity="1",e.style.transform="translateY(0)",e.classList.remove("swiping"))},{passive:!0,signal:t}),e.addEventListener("touchcancel",function(t){e.style.opacity="1",e.style.transform="translateY(0)",e.classList.remove("swiping"),o=!1},{passive:!0,signal:t})}function f(){const e=window.LiveScoreApp.Utils.jQuery;e&&(window.LiveScoreApp.Modules.MatchDetails&&window.LiveScoreApp.Modules.MatchDetails.setCurrentTab(null),e.$(".live-scores-tab-content").removeClass("live-scores-active entering exiting slide-left slide-right").css("display",""),e.$(".live-scores-menu-item").removeClass("active").removeAttr("aria-selected"))}function y(){[{wrapper:".nav-scroll-wrapper",scrollable:".tournament-nav"},{wrapper:".players-tabs-wrapper",scrollable:".players-tabs"}].forEach(function(e){document.querySelectorAll(e.wrapper).forEach(function(t){var n=t.querySelector(e.scrollable);function i(){var e=n.scrollLeft,i=n.scrollWidth-n.clientWidth;i<=2?t.classList.remove("can-scroll-left","can-scroll-right"):(t.classList.toggle("can-scroll-left",e>4),t.classList.toggle("can-scroll-right",e<i-4))}n&&(n.addEventListener("scroll",i,{passive:!0}),window.addEventListener("resize",i,{passive:!0}),requestAnimationFrame(i))})})}function g(){document.querySelectorAll(".tournament-nav, .players-tabs").forEach(function(e){var t,n,i=!1;e.addEventListener("mousedown",function(a){0===a.button&&(i=!0,e.style.cursor="grabbing",e.style.userSelect="none",t=a.pageX-e.offsetLeft,n=e.scrollLeft)}),e.addEventListener("mouseleave",function(){i&&(i=!1,e.style.cursor="",e.style.userSelect="")}),e.addEventListener("mouseup",function(){i&&(i=!1,e.style.cursor="",e.style.userSelect="")}),e.addEventListener("mousemove",function(a){if(i){a.preventDefault();var o=1.5*(a.pageX-e.offsetLeft-t);e.scrollLeft=n-o}}),e.addEventListener("click",function(t){Math.abs(e.scrollLeft-n)>5&&(t.preventDefault(),t.stopPropagation())},!0)})}return"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){y(),g()}):requestAnimationFrame(function(){y(),g()}),{throttle:function(e,t){let n;return function(){const i=arguments;n||(e.apply(this,i),n=!0,setTimeout(()=>n=!1,t))}},debounce:e,adjustMatchDetailsPosition:r,debouncedAdjustMatchDetailsPosition:c,startPositioningLoop:n,stopPositioningLoop:i,onMatchDetailsOpen:function(){var e=document.getElementById("match-details");e&&(window.innerWidth<=768&&(d(),function(e){s();var t=document.createElement("button");t.className="md-scroll-top",t.setAttribute("aria-label","Yukarı çık"),t.setAttribute("type","button"),t.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.5" aria-hidden="true"><polyline points="18 15 12 9 6 15"/></svg>',document.body.appendChild(t),o=t,a=function(){e.scrollTop>250?t.classList.add("md-st-visible"):t.classList.remove("md-st-visible")},e.addEventListener("scroll",a,{passive:!0}),t.addEventListener("click",function(){e.scrollTo({top:0,behavior:"smooth"})})}(e)),e.style.display="block",r(),n(),setTimeout(function(){window.innerWidth<=768&&e&&e.classList&&e.classList.add("entrance-animation")},50))},onMatchDetailsClose:function(){s(),i();var e=document.getElementById("match-details");e&&(e.style.display="none",e.style.transform="",e.style.top="",e.style.maxHeight=""),p()},lockBodyScroll:d,unlockBodyScroll:p,setupDomEventListeners:function(){window.addEventListener("resize",m,{passive:!0}),window.addEventListener("scroll",m,{passive:!0}),document.addEventListener("DOMContentLoaded",r),v(),function(){function e(){clearTimeout(h),h=setTimeout(function(){var e=window.LiveScoreApp.Utils.DeviceDetect;e&&"function"==typeof e.invalidateCache&&e.invalidateCache(),r();var t=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",t+"px");var n=document.getElementById("match-details");n&&!n.classList.contains("detail-closed")&&(n.scrollTop=0)},300)}window.addEventListener("orientationchange",e,{passive:!0}),screen.orientation&&screen.orientation.addEventListener&&screen.orientation.addEventListener("change",e)}()},cleanupDomEventListeners:function(){window.removeEventListener("resize",m),window.removeEventListener("scroll",m),document.removeEventListener("DOMContentLoaded",r),w&&(w.abort(),w=null)},setupTouchSwipeHandler:v,addTournamentFlag:function(e){if(!e||!e.length)return;const t="https://cdn.sporkolik.net/flags/"+(e.data("alpha2")||"world")+".png";if(0===e.find(".live-scores-tournament-flag").length){const n=e.find(".live-scores-tournament-name").text()||"Turnuva";e.prepend('<img src="'+t+'" alt="'+n.trim()+' bayrağı" class="live-scores-tournament-flag" width="24" height="24">')}},attachMatchClickEvents:function(e){const t=window.LiveScoreApp.Utils.jQuery;if(!t)return;const n=window.LiveScoreApp.LiveScores,i=window.LiveScoreApp.ScriptManager;n&&i&&(t.$("#live-scores").off("click",".live-scores-match").on("click",".live-scores-match",function(a){a.preventDefault();const o=a.target.closest(".analysis-badge");if(o){const e=o.dataset.href;return void(e&&window.open(e,"_blank","noopener,noreferrer"))}const s=t.$(this),r=s.data("match-id");if(!r)return;s.find(".live-scores-team").each(function(e){const n=t.$(this).find(".live-scores-score"),i=0===e?"home":"away",a=parseInt(n.text())||0;void 0===n.attr(`data-old-score-${i}`)&&n.attr(`data-old-score-${i}`,a)}),window._matchOpenTimer&&(clearTimeout(window._matchOpenTimer),window._matchOpenTimer=null);const c=function(){const i=window.LiveScoreApp.Modules.MatchDetails;i&&(n.getSelectedMatchId()===r?("function"==typeof i.closeMatchDetails?i.closeMatchDetails():t.$("#match-details").hide(),n.setSelectedMatchId(null),f(),window._matchOpenTimer=setTimeout(function(){window._matchOpenTimer=null,n.setSelectedMatchId(r),i.updateMatchDetails(r),e&&"function"==typeof e.updatePerformanceMetric&&e.updatePerformanceMetric("userInteraction","match-card-reclick")},50)):(n.setSelectedMatchId(r),window.LiveScoreApp.Modules.MatchDetails&&"function"==typeof window.LiveScoreApp.Modules.MatchDetails.closeMatchDetails?(i.closeMatchDetails(),n.setSelectedMatchId(r),window._matchOpenTimer=setTimeout(function(){window._matchOpenTimer=null,i.updateMatchDetails(r),e&&"function"==typeof e.updatePerformanceMetric&&e.updatePerformanceMetric("userInteraction","match-card-click")},50)):(i.updateMatchDetails(r),n.setSelectedMatchId(r))),"function"==typeof i.checkAndFetchLineups&&setTimeout(function(){i.checkAndFetchLineups(r)},1e3))};if(window.LiveScoreApp.Modules.MatchDetails&&"function"==typeof window.LiveScoreApp.Modules.MatchDetails.updateMatchDetails)c();else{const e="/wp-content/plugins/v7/js/modules/match-details.js";i.loadScript(e,"MatchDetails",{onLoad:function(){c()},onError:function(e){t.$("#match-details").html("<p>Maç detayları yüklenirken bir hata oluştu. Lütfen daha sonra tekrar deneyin.</p>").show()}})}}),t.$(window).off("scroll").on("scroll",function(){const t=Date.now();t-(window.lastScrollCleanupTime||0)>3e5&&(window.lastScrollCleanupTime=t,e&&"function"==typeof e.cleanupOnScroll&&e.cleanupOnScroll())}))},resetTabStates:f,setupMatchDetailsUI:function(e){const t=window.LiveScoreApp.Utils.jQuery;if(!t)return;const n=t.$("#match-details");t.$("#attack-momentum-chart").css("display",""),r(),"notstarted"===e&&t.$('.live-scores-menu-item[data-tab="details"]').hide(),n.show(),f(),"finished"===e&&t.$(".live-scores-match-time").text("Bitti"),window.matchDetailsEventSetup||(t.$(window).on("resize.matchDetails scroll.matchDetails",r),window.matchDetailsEventSetup=!0,window.addEventListener("beforeunload",function(){t.$(window).off("resize.matchDetails scroll.matchDetails"),window.matchDetailsEventSetup=!1}))}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.Compression=function(){const e=window.LiveScoreApp.Config;function t(e){if(!e||"string"!=typeof e)return e;try{return e.replace(/\s+/g," ").replace(/\>\s+\</g,"><").replace(/\s+\/\>/g,"/>").trim()}catch(t){return e}}function n(n){if(!e.optimizationSettings.compressLargeData)return n;try{return"string"==typeof n?t(n):n&&"object"==typeof n?JSON.parse(JSON.stringify(n)):n}catch(e){return n}}const i=function(){const e={compressedRequests:0,originalSizeTotal:0,compressedSizeTotal:0,savedBytes:0};return{updateStats:function(t,n){e.compressedRequests++,e.originalSizeTotal+=t,e.compressedSizeTotal+=n,e.savedBytes+=t-n},getStats:function(){return{...e}},logStats:function(){return e}}}();return{compressHtml:t,compressDataForCache:n,getOptimizedCache:function(e,t){return window.LiveScoreApp.Utils.Cache.getFromCacheByType(e,t)||null},setOptimizedCache:function(e,t,i,a){const o=window.LiveScoreApp.Utils.Cache,s=n(t);o.setToCacheByType(e,s,i,a)},compressData:function(e){if(null==e)return{compressed:!1,data:e};try{const t=JSON.stringify(e);if(t.length<10240)return{compressed:!1,data:e};const n=JSON.stringify(e),i=t.length;if(i-n.length<1024)return{compressed:!1,data:e};const a=btoa(encodeURIComponent(n));return{compressed:!0,type:"json-compact",data:a,originalSize:i,compressedSize:a.length}}catch(t){return{compressed:!1,data:e}}},decompressData:function(e){if(!e||null===e||!e.compressed)return e&&void 0!==e.data?e.data:e;try{if("json-compact"===e.type){const t=decodeURIComponent(atob(e.data));return JSON.parse(t)}return e.data}catch(t){return e.data||null}},optimizeResponse:function(e,t){if(!e||"object"!=typeof e)return e;if(JSON.stringify(e).length/1024<10)return e;const n={...e};switch(t){case"live":n.events&&Array.isArray(n.events)&&(n.events=n.events.map(e=>({id:e.id,customId:e.customId,status:e.status,tournament:{name:e.tournament.name,uniqueTournament:{id:e.tournament.uniqueTournament.id,name:e.tournament.uniqueTournament.name}},homeTeam:{id:e.homeTeam.id,name:e.homeTeam.name,shortName:e.homeTeam.shortName},awayTeam:{id:e.awayTeam.id,name:e.awayTeam.name,shortName:e.awayTeam.shortName},homeScore:e.homeScore,awayScore:e.awayScore,startTimestamp:e.startTimestamp,time:e.time})));break;case"match":if(n.event){const e=n.event;n.event={id:e.id,customId:e.customId,status:e.status,homeTeam:{id:e.homeTeam.id,name:e.homeTeam.name},awayTeam:{id:e.awayTeam.id,name:e.awayTeam.name},homeScore:e.homeScore,awayScore:e.awayScore,startTimestamp:e.startTimestamp,time:e.time}}break;case"incidents":n.incidents&&Array.isArray(n.incidents)&&(n.incidents=n.incidents.map(e=>{const t={...e};return t.player&&"object"==typeof t.player&&(t.player={...t.player,statistics:void 0,detailedStats:void 0}),["playerIn","playerOut","assist"].forEach(e=>{t[e]&&"object"==typeof t[e]&&(t[e]={...t[e],statistics:void 0,detailedStats:void 0})}),t}));break;case"h2h":n.events&&Array.isArray(n.events)&&(n.events=n.events.map(e=>({id:e.id,startTimestamp:e.startTimestamp,tournament:{name:e.tournament.name},homeTeam:{id:e.homeTeam.id,name:e.homeTeam.name},awayTeam:{id:e.awayTeam.id,name:e.awayTeam.name},homeScore:e.homeScore,awayScore:e.awayScore})))}return n},updateCompressionStats:i.updateStats,getCompressionStats:i.getStats,logCompressionStats:i.logStats}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.ExtraTimeTracker=window.LiveScoreApp.ExtraTimeTracker||{matches:new Map,initialized:!1,intervalId:null},window.LiveScoreApp.Utils.calculateAggregatedWinner=function(e){if(!e||!e.homeScore||!e.awayScore)return 0;let t=0,n=0;void 0!==e.homeScore.aggregated&&void 0!==e.awayScore.aggregated?(t=e.homeScore.aggregated,n=e.awayScore.aggregated):void 0!==e.homeScore.display&&void 0!==e.awayScore.display&&(t=e.homeScore.display,n=e.awayScore.display);let i=0;return t>n?i=1:n>t?i=2:void 0!==e.homeScore.penalties&&void 0!==e.awayScore.penalties&&(e.homeScore.penalties>e.awayScore.penalties?i=1:e.awayScore.penalties>e.homeScore.penalties&&(i=2)),i},window.LiveScoreApp.Utils.MinuteCalculator=function(){const e=window.LiveScoreApp.Utils.jQuery,t=window.LiveScoreApp.ExtraTimeTracker,n=window.LiveScoreApp.Utils.Cache,i=(window.LiveScoreApp.Config,"LIVE_MINUTE_");let a=5e3;try{window.LiveScoreApp&&window.LiveScoreApp.Constants&&"function"==typeof window.LiveScoreApp.Constants.getCacheTTL&&(a=window.LiveScoreApp.Constants.getCacheTTL("LIVE_TEXT","live"))}catch(e){}function o(e){return e&&"string"==typeof e?e.replace(/\s+/g," ").replace(/>\s+</g,"><").trim().toLowerCase():""}function s(e,n){if(!t.matches.has(e)&&n){const i=n.time&&n.time.extra?Math.ceil(n.time.extra/60):0,a=(n.time&&n.time.currentPeriodStartTimestamp?n.time.currentPeriodStartTimestamp:0)+(n.statusTime.max-n.statusTime.initial),o=Math.floor(Date.now()/1e3),s=Math.max(0,o-a),r=Math.floor(s/60),c=Math.floor(s%60);t.matches.set(e,{extraTime:i,elapsedMinutes:r,elapsedSeconds:c,normalTimeEnd:a,lastUpdate:o})}return t.initialized||r(),t.matches.get(e)||{extraTime:0,elapsedMinutes:0,elapsedSeconds:0}}function r(){t.intervalId&&(clearInterval(t.intervalId),t.intervalId=null),t.intervalId=setInterval(function(){const e=Math.floor(Date.now()/1e3);t.matches.forEach((t,n)=>{const i=e-t.lastUpdate;if(i>=1){let a=60*t.elapsedMinutes+t.elapsedSeconds+i;t.elapsedMinutes=Math.floor(a/60),t.elapsedSeconds=Math.floor(a%60),t.lastUpdate=e,c(n)}})},5e3),t.initialized=!0}function c(n){const i=t.matches.get(n);if(i&&e&&e.$){const t=e.$("#match-details .live-scores-match-time");if(t.length&&t.data("match-id")===n){const e=`${i.elapsedMinutes}:${i.elapsedSeconds<10?"0"+i.elapsedSeconds:i.elapsedSeconds}`;t.find(".extra-time-elapsed").text(e)}const a=e.$(`.live-scores-match[data-match-id="${n}"]`);if(a.length){const e=a.find(".live-scores-minute, .minute");if(e.length&&e.find(".extra-time-elapsed").length){const t=`${i.elapsedMinutes}:${i.elapsedSeconds<10?"0"+i.elapsedSeconds:i.elapsedSeconds}`;e.find(".extra-time-elapsed").text(t)}}}}function l(e,t,n,i){if((!e||""===e.trim())&&t&&(t.includes("started")||"Started"===t||"1st half"===t||"2nd half"===t))return"";const a=e?e.trim():"";if(a&&a.match(/(İY|UZT İY|Pen|Başlamadı|Ertelendi|Gecikme|İptal)/)){if("İY"!==a&&"UZT İY"!==a||"1st half"!==t&&"2nd half"!==t&&"1nd extra"!==t&&"1st extra"!==t&&"2nd extra"!==t&&"Extra 1st half"!==t&&"Extra 2nd half"!==t)return a;if(i&&i.time&&i.time.currentPeriodStartTimestamp){const e=i.time.currentPeriodStartTimestamp,n=Math.floor(Date.now()/1e3-e),a=i.time&&i.time.period?i.time.period:"2nd half"===t?2:1,o=2===a?45:0,s=Math.min(o+Math.floor(n/60),2===a?90:45);if(s>0)return s+"'"}}const o=(e||"").replace(/['\s]/g,"");if("Halftime"===t)return"İY";if("Extra time halftime"===t)return"UZT İY";if("Penalties"===t)return"Pen. Bek.";if(["1nd extra","1st extra","Extra 1st half","2nd extra","Extra 2nd half"].includes(t)){const e=["1nd extra","1st extra","Extra 1st half"].includes(t)?"UZ1":"UZ2",n=o.replace(/UZ1|UZ2/g,"").trim(),i=parseInt(n);return isNaN(i)?e+"'":i>15?e+" 15+'":e+" "+i+"'"}if(o.includes("+"))return o;{const e=parseInt(o);return isNaN(e)?o.includes("'")?o:o+"'":"1st half"===t&&e>45?"45+'":"2nd half"===t&&e>90?"90+'":e+"'"}}return{formatMinute:l,getFormattedMinute:function(e){const t=e.data("status"),n=e.data("status-description")||"",i=e.find(".live-scores-minute, .minute").text()||"",a=e.data("match-id");let o=null;o=window.LiveScoreApp.LiveMatches&&window.LiveScoreApp.LiveMatches.get(a)?window.LiveScoreApp.LiveMatches.get(a):{statusTime:{initial:e.data("initial-time")||0,max:e.data("max-time")||5400,timestamp:e.data("timestamp")||0,extra:e.data("extra-time")||0},time:{currentPeriodStartTimestamp:e.data("period-start")||0}};const s=e.find(".live-scores-score");["notstarted","postponed","delayed","canceled"].includes(t)?s.addClass("hidden"):s.removeClass("hidden");const r=e.find(".live-scores-minute, .minute").html()||"";let c="";c="notstarted"===t?'<span class="match-status match-status-notstarted">Başlamadı</span>':"finished"===t?'<span class="match-status match-status-finished">Bitti</span>':"postponed"===t?'<span class="match-status match-status-postponed">Ertelendi</span>':"delayed"===t?'<span class="match-status match-status-postponed">Gecikme</span>':"canceled"===t?'<span class="match-status match-status-postponed">İptal</span>':l(i,n,0,o);const d=r.includes("match-status-live"),p=c.includes("match-status-live");return d&&p?r:c},updateMinuteDisplay:function(e,t,n,i,a){const s=e.html()||"",r=l(t,n,0,a);o(s)!==o(r)&&e.html(r)},getFormattedExtraTime:function(e,t){const n=s(e,t),i=`${n.elapsedMinutes}:${n.elapsedSeconds<10?"0"+n.elapsedSeconds:n.elapsedSeconds}`;return{extraTime:n.extraTime,elapsedTime:i}},initExtraTimeData:s,startAutoUpdate:r,stopAutoUpdate:function(){t.intervalId&&(clearInterval(t.intervalId),t.intervalId=null),t.initialized=!1},updateExtraTimeUI:c,getCachedLiveText:function(e,t){const o=`${e}_${t}`;if(!n||"function"!=typeof n.getFromCacheByType)return"";let s=n.getFromCacheByType(o,i);return s||(s="","function"==typeof n.setToCacheByType&&n.setToCacheByType(o,s,a,i)),s}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.SecurityUtils=function(){"use strict";function e(e){if(!e||"string"!=typeof e)return"";const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};return e.replace(/[&<>"'\/]/g,function(e){return t[e]})}function t(n){if(!n||"object"!=typeof n)return n;const i=Array.isArray(n)?[]:{};for(const a in n)if(n.hasOwnProperty(a)){const o=n[a];i[a]="string"==typeof o?e(o):null!==o&&"object"==typeof o?t(o):o}return i}return{escapeHtml:e,escapeUrlParam:function(e){return e&&"string"==typeof e?encodeURIComponent(e):""},sanitizeObject:t,validateMatchData:function(n){if(!n||"object"!=typeof n)return{};const i={},a=["matchId","homeTeamName","awayTeamName","matchStatus"],o=["homeTeamName","awayTeamName","matchTime","matchStatus","league","city","stadium","referee","homeTeamImage","awayTeamImage"],s=["homeRedCards","awayRedCards"];for(const e of a)void 0===n[e]||n[e];for(const t of o)n[t]&&"string"==typeof n[t]?i[t]=e(n[t]):n[t]&&(i[t]=n[t]);for(const e of s)void 0!==n[e]&&null!==n[e]?(i[e]=parseInt(n[e],10)||0,i[e]<0&&(i[e]=0)):i[e]=0;n.homeScore&&"object"==typeof n.homeScore&&(i.homeTeamScore=n.homeScore.current||0,i.homeTeamDisplayScore=n.homeScore.display||0,i.homeAggregatedScore=n.homeScore.aggregated||null,i.homePenaltiesScore=n.homeScore.penalties||null),n.awayScore&&"object"==typeof n.awayScore&&(i.awayTeamScore=n.awayScore.current||0,i.awayTeamDisplayScore=n.awayScore.display||0,i.awayAggregatedScore=n.awayScore.aggregated||null,i.awayPenaltiesScore=n.awayScore.penalties||null);for(const e in n)if(!i.hasOwnProperty(e)&&n.hasOwnProperty(e)){if("homeScore"===e||"awayScore"===e)continue;"object"==typeof n[e]&&null!==n[e]?i[e]=t(n[e]):i[e]=n[e]}return i},renderTemplate:function(e,t){return"string"==typeof e&&t?e.replace(/\$\{([^}]+)\}/g,function(e,n){const i=n.split(".");let a=t;for(const e of i){if(!a||"object"!=typeof a||!(e in a))return"";a=a[e]}return"string"==typeof a?a:null==a?"":String(a)}):""},sanitizeHtml:function(e,t=["div","span","p","br","strong","em","i","header","nav","button","h1","h2","h3","a","ul","li"]){if("string"!=typeof e)return"";const n=document.createElement("div");return n.innerHTML=e,function e(n){for(let i=n.children.length-1;i>=0;i--){const a=n.children[i],o=a.tagName.toLowerCase();if(["script","iframe","style","link","meta","object","embed"].includes(o))a.remove();else if(t.includes(o)){const t=["onload","onerror","onclick","onmouseover","on"];for(const e of t)for(let t=0;t<a.attributes.length;t++)a.attributes[t].name.startsWith(e)&&(a.removeAttribute(a.attributes[t].name),t--);e(a)}else{for(;a.firstChild;)n.insertBefore(a.firstChild,a);a.remove()}}}(n),n.innerHTML},validateApiResponse:function(e){return!(!e||"object"!=typeof e)&&"status"in e&&"data"in e},isValidUrl:function(e){if("string"!=typeof e)return!1;try{const t=new URL(e);return["http:","https:"].includes(t.protocol)}catch(e){return!1}},createSafeEventHandler:function(e,t){const n=JSON.parse(JSON.stringify(t||{}));return function(t){try{e.call(this,t,n)}catch(e){}}},version:"1.0.0",name:"SecurityUtils"}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.RequestIdGenerator=function(){"use strict";const e={},t={},n={generated:0,validated:0,failed:0,cleaned:0};function i(){const e=Date.now(),i=[];for(const n in t){const a=t[n];(e-a.timestamp>3e4||a._scheduleDelete&&e>=a._scheduleDelete)&&i.push(n)}i.forEach(function(e){delete t[e]}),n.cleaned+=i.length;const a=Object.keys(t);if(a.length>200){const e=a.sort(function(e,n){return t[e].timestamp-t[n].timestamp}).slice(0,Math.ceil(40));e.forEach(function(e){delete t[e]}),n.cleaned+=e.length,window.LiveScoreApp.debugMode}return i.length}return{generateId:function(a,o){void 0===o&&(o="get_match_details");var s="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)});return e[a+"_"+o]=s,t[s]={matchId:a,type:o,timestamp:Date.now(),status:"pending"},n.generated++,Object.keys(t).length%50==0&&i(),window.LiveScoreApp.debugMode,s},getIdByMatchId:function(t,n){if(n)return e[t+"_"+n]||null;var i=t+"_";for(var a in e)if(0===a.indexOf(i))return e[a];return null},validateResponse:function(i,a){if(!a)return!1;var o=t[a];if(!o)return!1;if(String(o.matchId)!==String(i))return n.failed++,!1;var s=i+"_"+o.type,r=e[s];return!!r&&(r!==a?(n.failed++,window.LiveScoreApp.debugMode,!1):(n.validated++,window.LiveScoreApp.debugMode,!0))},markCompleted:function(e,n){return void 0===n&&(n="completed"),!!t[e]&&(t[e].status=n,t[e].completedAt=Date.now(),!0)},clearId:function(t){var n=t+"_",i=!1;for(var a in e)0===a.indexOf(n)&&(delete e[a],i=!0);return i&&window.LiveScoreApp.debugMode,i},clearAll:function(){var t=Object.keys(e).length;for(var n in e)delete e[n];return window.LiveScoreApp.debugMode,t},cancelByMatchId:function(n){var i=n+"_",a=!1;for(var o in e)if(0===o.indexOf(i)){var s=e[o];t[s]&&(t[s].status="cancelled",t[s].cancelledAt=Date.now(),t[s]._scheduleDelete=Date.now()+1e3),delete e[o],a=!0}return!!a&&(window.LiveScoreApp.debugMode,!0)},getDebugInfo:function(){var i=Object.values(t),a=i.filter(function(e){return"pending"===e.status}).length,o=i.filter(function(e){return"completed"===e.status}).length,s=i.filter(function(e){return"cancelled"===e.status}).length;return{totalTrackedRequests:Object.keys(t).length,activeMatchRequests:Object.keys(e).length,requestIdMap:Object.assign({},e),stats:{generated:n.generated,validated:n.validated,failed:n.failed,cleaned:n.cleaned,pending:a,completed:o,cancelled:s}}},cleanupOldRequests:i,_reset:function(){var i={requestIdMap:Object.assign({},e),requestMetadata:Object.assign({},t)};for(var a in e)delete e[a];for(var o in t)delete t[o];return n.generated=0,n.validated=0,n.failed=0,n.cleaned=0,i}}}(),"undefined"!=typeof module&&module.exports&&(module.exports=window.LiveScoreApp.Utils.RequestIdGenerator),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.MemcachedSync=function(){let e=0,t=!1,n=[],i={successCount:0,failureCount:0,lastResponse:null,avgResponseTime:0,totalResponseTime:0},a={isUrgent:!1,lastSkippedTime:0,totalSkippedRequests:0,serverResponseTime:0,nextSyncTime:0};function o(i,o=!1){const r=Date.now(),c=window.LiveScoreApp.Config;if(i&&(n.push(i),(i.totalSize>c.optimizationSettings.memcachedUrgentThreshold||i.removedCount>200)&&(o=!0),i.protectSpecialScores&&(i.protectedPatterns=i.protectedPatterns||["matchAggregateScore_","matchPreviousScore_","matchPenaltyScore_"])),a.isUrgent=o||a.isUrgent,t)return;const l=r-e,d=a.isUrgent?3e4:3e5;if(l<d){const e=d-l;return a.nextSyncTime=r+e,t=!0,void setTimeout(()=>{s()},e)}s()}function s(){const o=window.LiveScoreApp.Config,s=Date.now();if(t=!1,e=s,a.nextSyncTime=0,0===n.length)return;if(!o.optimizationSettings.memcachedIntegration||!window.LiveScoresAjax)return void(n=[]);const r={removedCount:0,totalSize:0,cacheSize:0,timestamp:e,forceCleanup:a.isUrgent,aggressiveMode:!1,protectSpecialScores:!0,protectedPatterns:["matchAggregateScore_","matchPreviousScore_","matchPenaltyScore_"],cacheTypes:{}};let c=0,l=0,d={};n.forEach(e=>{e.removedCount&&(r.removedCount+=e.removedCount,l=Math.max(l,e.removedCount)),e.totalSize&&(c+=e.totalSize,r.totalSize=Math.max(r.totalSize,e.totalSize)),e.cacheSize&&(r.cacheSize=Math.max(r.cacheSize,e.cacheSize)),e.cacheTypes&&Object.keys(e.cacheTypes).forEach(t=>{d[t]||(d[t]=0),d[t]+=e.cacheTypes[t].count||0})}),Object.keys(d).forEach(e=>{r.cacheTypes[e]||(r.cacheTypes[e]={count:0}),r.cacheTypes[e].count=d[e]}),(c>8e3||l>300||i.failureCount>2)&&(r.aggressiveMode=!0),n=[],a.isUrgent=!1;try{jQuery.ajax({url:window.LiveScoresAjax.ajax_url,type:"POST",async:!0,timeout:5e3,data:{action:"sync_memcached_cleanup",cleanup_stats:JSON.stringify(r)},success:function(e){const t=Date.now(),n=t-s;i.successCount++,i.lastResponse=e,i.totalResponseTime+=n,i.avgResponseTime=i.totalResponseTime/i.successCount,a.serverResponseTime=n,e&&e.data&&e.data.next_scheduled&&(a.nextSyncTime=1e3*e.data.next_scheduled),e&&e.data&&"skipped"===e.data.status&&(a.totalSkippedRequests++,a.lastSkippedTime=t)},error:function(e,t,n){i.failureCount++,i.failureCount}})}catch(e){i.failureCount++}}return{scheduleSyncWithServer:o,performServerSync:s,forceSyncWithServer:function(){n=[];const e=window.LiveScoreApp.Utils.Cache.getCacheStats(),t={removedCount:Math.max(100,Math.ceil(.1*e.totalEntries)),totalSize:e.totalSizeKB||1e3,cacheSize:e.totalEntries||100,forceCleanup:!0,aggressiveMode:!0,timestamp:Date.now(),cacheTypes:{}};return e.typeBreakdown&&Object.keys(e.typeBreakdown).forEach(n=>{t.cacheTypes[n]={count:e.typeBreakdown[n].count||0}}),o(t,!0),!0},getSyncStatus:function(){return{lastSync:e,pendingSync:t,queueLength:n.length,metrics:i,status:a,nextSync:a.nextSyncTime}},getMetrics:function(){return i}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.EventUtils=function(){const e=window.LiveScoreApp.Utils.jQuery,t=(window.LiveScoreApp.Utils.Cache,window.LiveScoreApp.Config,{mainApp:!1,matchDetails:!1,tabs:!1,custom:{}});function n(){e.$(".live-scores-back-button").off("click.matchDetails"),e.$(".live-scores-back-button").off("click"),e.$(document).off("click","#match-details .live-scores-back-button"),e.$(".live-scores-menu-item").off("click.matchDetails").off("keydown.matchDetails"),e.$("#performance-button").off("click.matchDetails"),e.$("#h2h-button").off("click.matchDetails"),e.$("#team-streaks-button").off("click.matchDetails"),e.$("#h2h-streaks-button").off("click.matchDetails"),e.$(document).off("keydown.matchDetails");const n=window.LiveScoreApp&&window.LiveScoreApp._detailGeneration||0;setTimeout(()=>{if(!((window.LiveScoreApp&&window.LiveScoreApp._detailGeneration||0)>n)&&window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.DomUtils&&"function"==typeof window.LiveScoreApp.Utils.DomUtils.cleanupDomEventListeners)try{window.LiveScoreApp.Utils.DomUtils.cleanupDomEventListeners(),window.LiveScoreApp.debugMode}catch(e){}},300),t.matchDetails=!1}function i(){e.$("#match-details").addClass("detail-closed"),e.$("#match-details").hide(),window.LiveScoreApp.Modules.MatchDetailsTabs&&window.LiveScoreApp.Modules.MatchDetailsTabs.cleanupIntervals(),n()}function a(){e.$("#all-matches").off("click.mainApp"),e.$("#live-matches").off("click.mainApp"),document.getElementById("date-picker").removeEventListener("change"),t.mainApp=!1}return{setupMainAppEventListeners:function(n={}){if(t.mainApp)return;const i=window.LiveScoreApp.LiveScores,a=window.LiveScoreApp.Utils.TimerManager;if(i){if(e.$("#all-matches").on("click.mainApp",function(){a&&a.clearInterval("main-score-update"),e.$("#all-matches").addClass("active"),e.$("#live-matches").removeClass("active"),e.$(".switch-menu").removeClass("indicator-right"),e.$(".date-picker-container").addClass("visible"),e.$("#quick-date-bar").addClass("visible"),i.setIsAllMatchesSelected(!0);const t=e.$("#date-picker").val().split("/");i.setIsSwitchingTab(!0),i.fetchLiveScores(t[0],t[1],t[2],"all"),n.clearCacheSmart&&"function"==typeof n.clearCacheSmart&&n.clearCacheSmart(["STANDING","JERSEY"]),n.onTabChange&&"function"==typeof n.onTabChange&&n.onTabChange("all"),n.updatePerformanceMetric&&"function"==typeof n.updatePerformanceMetric&&n.updatePerformanceMetric("userInteraction","all-matches-click")}),e.$("#live-matches").on("click.mainApp",function(){a&&i&&"function"==typeof i.startMainTimer&&i.startMainTimer(),e.$("#live-matches").addClass("active"),e.$("#all-matches").removeClass("active"),e.$(".switch-menu").addClass("indicator-right"),e.$(".date-picker-container").removeClass("visible"),e.$("#quick-date-bar").removeClass("visible"),"function"==typeof window.resetLeagueFilter&&window.resetLeagueFilter(),i.setIsAllMatchesSelected(!1),i.setIsSwitchingTab(!0),i.fetchLiveScores(null,null,null,"live"),n.clearCacheSmart&&"function"==typeof n.clearCacheSmart&&n.clearCacheSmart(["STANDING","JERSEY"]),n.onTabChange&&"function"==typeof n.onTabChange&&n.onTabChange("live"),n.updatePerformanceMetric&&"function"==typeof n.updatePerformanceMetric&&n.updatePerformanceMetric("userInteraction","live-matches-click")}),"function"==typeof flatpickr)try{flatpickr("#date-picker",{dateFormat:"d/m/Y",defaultDate:"today",locale:flatpickr.l10ns.tr,onChange:function(t,a,o){if(!t||!t.length)return;const s=a.split("/");i.setIsSwitchingTab(!0),i.fetchLiveScores(s[0],s[1],s[2],"all").then(()=>{n.updatePerformanceMetric&&"function"==typeof n.updatePerformanceMetric&&n.updatePerformanceMetric("dataLoaded","date-change")}).catch(t=>{e.$("#live-scores").html("<p>Veriler yüklenirken bir hata oluştu. Lütfen tekrar deneyin.</p>")}),n.onDateChange&&"function"==typeof n.onDateChange&&n.onDateChange(t[0]),window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.UI&&"function"==typeof window.LiveScoreApp.Modules.UI.updateBrowserURL&&window.LiveScoreApp.Modules.UI.updateBrowserURL("all",t[0]),n.clearCacheSmart&&"function"==typeof n.clearCacheSmart&&n.clearCacheSmart(["LIVESCORE"])}})}catch(t){e.$("#date-picker").attr("type","date")}else e.$("#date-picker").attr("type","date");document.getElementById("date-picker").addEventListener("change",function(e){const t=e.target.value;if(t&&/^\d{2}\/\d{2}\/\d{4}$/.test(t)){const[e,i,a]=t.split("/"),o=new Date(`${a}-${i}-${e}`);n.onDateChange&&"function"==typeof n.onDateChange&&n.onDateChange(o),window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.UI&&"function"==typeof window.LiveScoreApp.Modules.UI.updateBrowserURL&&window.LiveScoreApp.Modules.UI.updateBrowserURL("all",o),n.updatePerformanceMetric&&"function"==typeof n.updatePerformanceMetric&&n.updatePerformanceMetric("userInteraction","date-manual-change")}}),t.mainApp=!0}},setupMatchDetailsEventListeners:function(a,o={}){n(),e.$(".live-scores-back-button").off("click"),e.$(".live-scores-back-button").off("click.matchDetails"),e.$(document).off("click","#match-details .live-scores-back-button");const s=window.LiveScoreApp.Components||{},r=window.LiveScoreApp.Modules.MatchDetails;e.$(".live-scores-menu-item").on("click.matchDetails",function(){const t=e.$(this).data("tab");(r?r.getCurrentTab():null)!==t&&(e.$(".live-scores-menu-item").removeClass("active").attr("aria-selected","false"),e.$(this).addClass("active").attr("aria-selected","true"),r&&"function"==typeof r.updateTabContent?r.updateTabContent(a,t):window.LiveScoreApp.Modules.MatchDetailsTabs&&"function"==typeof window.LiveScoreApp.Modules.MatchDetailsTabs.updateTabContent&&window.LiveScoreApp.Modules.MatchDetailsTabs.updateTabContent(a,t))}),e.$(".live-scores-menu-item").on("keydown.matchDetails",function(t){const n=e.$(".live-scores-menu-item"),i=e.$(this),a=n.index(i);let o;switch(t.keyCode){case 37:case 38:t.preventDefault(),o=a>0?n.eq(a-1):n.eq(n.length-1),o.click().focus();break;case 39:case 40:t.preventDefault(),o=a<n.length-1?n.eq(a+1):n.eq(0),o.click().focus();break;case 36:t.preventDefault(),n.eq(0).click().focus();break;case 35:t.preventDefault(),n.eq(n.length-1).click().focus()}}),e.$(".live-scores-back-button").on("click.matchDetails",function(e){if(e.preventDefault(),e.stopPropagation(),"function"==typeof o.closeMatchDetails)o.closeMatchDetails(a);else{const e=window.LiveScoreApp?.Modules?.MatchDetails;e&&"function"==typeof e.closeMatchDetails?e.closeMatchDetails(a):i()}}),e.$("#performance-button").on("click.matchDetails",function(){e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),s&&s.History&&s.History.fetchPerformanceData(a)}),e.$("#h2h-button").on("click.matchDetails",function(){if(e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),s&&s.H2H){const t="finished"===e.$('.live-scores-match[data-match-id="'+a+'"]').data("status");s.H2H.fetchH2HData(a,t)}}),e.$("#team-streaks-button").on("click.matchDetails",function(){if(e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),s&&s.Streaks){const t="finished"===e.$('.live-scores-match[data-match-id="'+a+'"]').data("status");s.Streaks.fetchTeamStreaksData(a,t)}}),e.$("#h2h-streaks-button").on("click.matchDetails",function(){if(e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),s&&s.Streaks){const t="finished"===e.$('.live-scores-match[data-match-id="'+a+'"]').data("status");s.Streaks.fetchH2HStreaksData(a,t)}}),window.innerWidth<=768||/Android|webOS|iPhone|iPad|iPod/.test(navigator.userAgent)||e.$(document).on("keydown.matchDetails",function(e){27===e.keyCode&&o.closeMatchDetails&&"function"==typeof o.closeMatchDetails&&o.closeMatchDetails()}),t.matchDetails=!0},cleanupMainAppEventListeners:a,cleanupMatchDetailsEventListeners:n,cleanupAllEventListeners:function(){a(),n()},closeMatchDetails:i,getActiveEventListeners:function(){return Object.assign({},t)}}}(),window.LiveScoreApp._checkBackButtonAttachment||(window.LiveScoreApp._checkBackButtonAttachment=function(){Date.now();const e=jQuery(".live-scores-back-button");if(e.length,0===e.length)return!1;const t=jQuery._data(e[0],"events"),n=t&&t.click&&t.click.some(e=>e.namespace.includes("matchDetails"));return e.each((e,t)=>{jQuery(t)}),n}),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.PollingCoordinator=function(){"use strict";const e=new Map;let t=!1;function n(t){const n=e.get(t);n&&(c(n),e.delete(t),window.LiveScoreApp.debugMode)}function i(){e.forEach(function(e){c(e)})}function a(){t=!0,i(),window.LiveScoreApp.debugMode}function o(){t=!1;let n=0;e.forEach(function(i){i.lastFetch>0&&(setTimeout(function(){!t&&e.has(i.name)&&r(i)},2e3*n),n++)}),window.LiveScoreApp.debugMode}function s(){let t=0;return e.forEach(function(e){e.isActive&&t++}),t}function r(e){if(e.isActive)return;const n=window.LiveScoreApp.Utils.TimerManager,i=function(){if("hidden"!==document.visibilityState&&!t&&("function"!=typeof e.shouldPoll||e.shouldPoll())){e.lastFetch=Date.now();try{e.fetchFn()}catch(e){}}};n&&"function"==typeof n.setNamedInterval?e.timerId=n.setNamedInterval(i,e.interval,"poll_"+e.name):e.timerId=setInterval(i,e.interval),e.isActive=!0}function c(e){if(!e.isActive&&!e.timerId)return;const t=window.LiveScoreApp.Utils.TimerManager;t&&"function"==typeof t.clearNamedInterval?t.clearNamedInterval("poll_"+e.name):e.timerId&&clearInterval(e.timerId),e.timerId=null,e.isActive=!1}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState?a():o()}),{register:function(t,i){t&&i&&"function"==typeof i.fetchFn&&(e.has(t)&&n(t),e.set(t,{name:t,fetchFn:i.fetchFn,interval:i.interval||3e4,shouldPoll:i.shouldPoll||(()=>!0),matchId:i.matchId||null,timerId:null,isActive:!1,lastFetch:0}),window.LiveScoreApp.debugMode)},unregister:n,start:function(n){const i=e.get(n);!i||i.isActive||t||r(i)},stop:function(t){const n=e.get(t);n&&c(n)},startAll:function(n){if(t)return;let i=0;e.forEach(function(a){n&&a.matchId!==n||a.isActive||(setTimeout(function(){!t&&e.has(a.name)&&r(a)},2e3*i),i++)})},stopAll:i,pauseAll:a,resumeAll:o,cleanupForMatch:function(t){e.forEach(function(e,i){e.matchId===t&&n(i)})},cleanupAll:function(){i(),e.clear()},getRegisteredCount:function(){return e.size},getActiveCount:s,getStatus:function(){const n={};return e.forEach(function(e,t){n[t]={isActive:e.isActive,interval:e.interval,matchId:e.matchId,lastFetch:e.lastFetch?new Date(e.lastFetch).toISOString():null}}),{isPaused:t,registered:e.size,active:s(),pollers:n}}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.PlayerModuleLoader=function(){"use strict";var e=!1,t=!1,n=null,i="?v="+Date.now(),a=["/wp-content/plugins/v7/js/components/player-charts.js"+i,"/wp-content/plugins/v7/js/components/player-popup.js"+i];function o(){return t?Promise.resolve({PlayerCharts:window.LiveScoreApp.Components.PlayerCharts,PlayerPopup:window.LiveScoreApp.Components.PlayerPopup,cached:!0}):e?n:(e=!0,n=function(e){if(!e||0===e.length)return Promise.resolve();var t=0;return function n(){if(t>=e.length)return Promise.resolve();var i,a=e[t];return t++,(i=a,new Promise(function(e,t){var n=i.split("?")[0],a=document.querySelector('script[src^="'+n+'"]');a&&a.parentNode.removeChild(a);var o=document.createElement("script");o.src=i,o.type="text/javascript",o.async=!1,o.charset="utf-8";var s=setTimeout(function(){o.onerror=null,o.onload=null,t(new Error("Script load timeout: "+i))},15e3);o.onload=function(){clearTimeout(s),e()},o.onerror=function(){clearTimeout(s),t(new Error("Failed to load script: "+i))},document.head.appendChild(o)})).then(function(){return n()})}()}(a).then(function(){t=!0,e=!1;var n=window.LiveScoreApp.Components.PlayerCharts,i=window.LiveScoreApp.Components.PlayerPopup;return n&&i?{PlayerCharts:n,PlayerPopup:i,cached:!1}:Promise.reject(new Error("Modules loaded but undefined"))}).catch(function(t){return e=!1,Promise.reject(t)}))}return{load:function(e){o().then(function(t){e&&"function"==typeof e&&e(null,t)}).catch(function(t){e&&"function"==typeof e&&e(t,null)})},loadAsync:function(){return o()},isReady:function(){return t},version:"1.0.0"}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.LazySectionLoader=function(){"use strict";var e=!1,t=null,n=[{selector:".player-page",action:"render_player_lazy_sections",getParams:function(e){return{player_id:parseInt(e.dataset.playerId,10)||0,tournament_id:parseInt(e.dataset.tournamentId,10)||0,season_id:parseInt(e.dataset.seasonId,10)||0}},isValid:function(e){return e.player_id>0}},{selector:".team-page",action:"render_team_lazy_sections",getParams:function(e){return{team_id:parseInt(e.dataset.teamId,10)||0,tournament_id:parseInt(e.dataset.tournamentId,10)||0,season_id:parseInt(e.dataset.seasonId,10)||0}},isValid:function(e){return e.team_id>0}},{selector:".tournament-page",action:"render_tournament_lazy_sections",getParams:function(e){return{tournament_id:parseInt(e.dataset.tournamentId,10)||0,season_id:parseInt(e.dataset.seasonId,10)||0}},isValid:function(e){return e.tournament_id>0}}];function i(e,t){var n=e.querySelector(".lazy-skeleton");n&&(n.innerHTML=t,n.classList.remove("skeleton-shimmer")),e.removeAttribute("data-lazy-endpoint")}function a(e,t,n,a,s){if(0!==a.length){var r=Date.now(),c=window.LiveScoresAjax&&window.LiveScoresAjax.ajax_url||"/wp-admin/admin-ajax.php",l=new FormData;l.append("action",t),Object.keys(n).forEach(function(e){l.append(e,n[e])}),a.forEach(function(e){l.append("sections[]",e)});var d="undefined"!=typeof AbortController?new AbortController:null,p=d?setTimeout(function(){d.abort()},1e4):null;fetch(c,{method:"POST",body:l,signal:d?d.signal:void 0}).then(function(e){if(p&&clearTimeout(p),!e.ok)throw new Error("HTTP "+e.status);return e.json()}).then(function(c){c.success&&c.data?(a.forEach(function(t){var n=e.querySelector('[data-lazy-endpoint="'+t+'"]');if(n){var a=c.data[t];if(a&&a.length>0){var o=document.createElement("div");o.innerHTML=a;var s=o.firstElementChild;s&&n.parentNode.replaceChild(s,n)}else i(n,'<p class="no-data-message">Veri bulunamadı.</p>')}}),"function"==typeof window.__playerPageInitCharts&&setTimeout(window.__playerPageInitCharts,200),function(e){if(window.UserInteractionMonitor&&window.UserInteractionMonitor.getMetrics)try{var t=window.UserInteractionMonitor.getMetrics();t&&t.webVitals&&(t.webVitals.lazySectionLoad=Math.round(e))}catch(e){}}(Date.now()-r)):o(e,a,t,n,s)}).catch(function(i){o(e,a,t,n,s)})}}function o(e,t,n,o,s){s?t.forEach(function(t){var n=e.querySelector('[data-lazy-endpoint="'+t+'"]');n&&i(n,'<p class="no-data-message">Veri yüklenemedi.</p>')}):setTimeout(function(){var i=[];t.forEach(function(t){e.querySelector('[data-lazy-endpoint="'+t+'"]')&&i.push(t)}),i.length>0&&a(e,n,o,i,!0)},5e3)}function s(e,n,i,o){"undefined"!=typeof IntersectionObserver?(t=new IntersectionObserver(function(o){var s=[];o.forEach(function(e){if(e.isIntersecting){var n=e.target.dataset.lazyEndpoint;n&&s.push(n),t.unobserve(e.target)}}),s.length>0&&a(e,n,i,s,!1)},{rootMargin:"200px"}),o.forEach(function(n){var i=e.querySelector('[data-lazy-endpoint="'+n+'"]');i&&t.observe(i)})):setTimeout(function(){a(e,n,i,o,!1)},700)}function r(){if(!e)for(var t=0;t<n.length;t++){var o=n[t],r=document.querySelector(o.selector);if(r){var c=r.querySelectorAll("[data-lazy-endpoint]");if(0!==c.length){var l=o.getParams(r);if(o.isValid(l)){e=!0;var d={1:[],2:[],3:[]};return c.forEach(function(e){var t=parseInt(e.dataset.lazyPriority,10)||3;(t<1||t>3)&&(t=3),d[t].push(e.dataset.lazyEndpoint)}),d[1].length>0&&function(e){setTimeout(function(){a(r,o.action,l,e,!1)},300)}(d[1]),d[2].length>0&&function(e){setTimeout(function(){a(r,o.action,l,e,!1)},700)}(d[2]),void(d[3].length>0&&s(r,o.action,l,d[3]))}c.forEach(function(e){i(e,'<p class="no-data-message">Sayfa parametreleri eksik.</p>')})}}}}function c(){var e=document.querySelectorAll("[data-lazy-endpoint]");0!==e.length&&e.forEach(function(e){i(e,'<p class="no-data-message">Veri yüklenemedi. Lütfen sayfayı yenileyin.</p>')})}return"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):setTimeout(r,100),window.addEventListener("load",function(){setTimeout(c,15e3)}),{init:r}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Modules=window.LiveScoreApp.Modules||{},window.LiveScoreApp.Modules.UI=function(){const e=window.LiveScoreApp.Utils.jQuery,t=window.LiveScoreApp.Utils.Cache,n=window.LiveScoreApp.Utils.DomUtils,i=(window.LiveScoreApp.Utils.RequestQueue,window.LiveScoreApp.Config);let a=!1,o={pageLoadTime:0,interactionCount:0,lastUserInteraction:0,memoryUsage:[]},s=!1;function r(e){return e&&"object"==typeof e&&e.hasOwnProperty("success")&&void 0!==e.data?e.data:e}const c=window.translations&&window.translations.months||["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"];function l(e,t){let n,i,a;const o=String(t.getDate()).padStart(2,"0"),s=(String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()),r=`${parseInt(o)} ${c[t.getMonth()]} ${s}`,l=new Date;l.setHours(0,0,0,0);const d=new Date(t);d.setHours(0,0,0,0);const p=d.getTime()>l.getTime();"live"===e?(n=`Canlı Skor - ${r} Güncel Maç Sonuçları | Sporkolik`,a=`Canlı Skor - ${r}`,i=`${r} canlı skor, maç sonuçları ve istatistikleri. Tüm ligler ve maçlar Sporkolik'te.`):"all"===e&&(p?(n=`${r} Futbol Maç Programı | Sporkolik`,a=`Tüm Maçlar - ${r}`,i=`${r} tarihli futbol maç programı, fikstür ve başlama saatleri.`):(n=`${r} Futbol Maç Sonuçları | Sporkolik`,a=`Tüm Maçlar - ${r}`,i=`${r} tarihli tüm futbol maçları, canlı skorlar ve detaylı istatistikler.`)),document.title=n;const u=document.getElementById("live-scores-page-title");u&&(u.textContent=a);const m=d.getTime()===l.getTime();let h;h="live"===e&&m?"Canlı Skor - Güncel Futbol Maç Sonuçları":`${r} ${p?"Futbol Maç Programı":"Futbol Maç Sonuçları"}`;const w=document.querySelector(".live-scores-page-h1");w&&(w.textContent=h),updateDynamicSeoText(e,t);const v=document.querySelector("meta[name='description']");if(v)v.setAttribute("content",i);else{const e=document.createElement("meta");e.setAttribute("name","description"),e.setAttribute("content",i),document.head.appendChild(e)}}function d(e=[]){if(!t)return;const n=e.map(e=>t.CACHE_PREFIX[e]?t.CACHE_PREFIX[e]:e);if(Object.values(t.CACHE_PREFIX).filter(e=>!n.includes(e)).forEach(e=>{t.clearCacheByType(e)}),window.gc)try{window.gc()}catch(e){}}function p(e){return window.LiveScoreApp&&window.LiveScoreApp[e]?window.LiveScoreApp[e]:null}function u(e){const t=p("LiveScores");if(!t)return;const n=p("Modules")&&p("Modules").MetaTags;e&&e instanceof Date&&!isNaN(e.getTime())||(e=new Date);try{n&&"function"==typeof n.updateMetaTags?n.updateMetaTags(t.getCurrentTab(),e):l(t.getCurrentTab(),e)}catch(t){const n=e.getDate().toString().padStart(2,"0"),i=(e.getMonth()+1).toString().padStart(2,"0"),a=e.getFullYear();document.title=`Canlı Skor - ${window.LiveScoreApp.formatNaturalDate(n,i,a)} Maç Programı | Sporkolik`}g(t.getCurrentTab(),e)}function m(e){const t=p("LiveScores");if(!t)return;t.getCurrentTab()!==e&&(t.setCurrentTab(e),"live"===e&&window.LiveScoreApp.hasHistoricalDataLoaded&&(window.LiveScoreApp.hasHistoricalDataLoaded=!1));const n=p("Modules")&&p("Modules").MetaTags;let i=new Date;if("all"===e){const e=document.getElementById("date-picker");e&&e._flatpickr&&e._flatpickr.selectedDates.length&&(i=e._flatpickr.selectedDates[0])}n&&"function"==typeof n.updateMetaTags?n.updateMetaTags(e,i):l(e,i),g(e,i)}function h(){t&&"function"==typeof t.cleanupCache&&window.requestAnimationFrame(function(){t.cleanupCache()})}function w(n,a){const o=n;if(t.getFromCacheByType(o,t.CACHE_PREFIX.STATISTIC))return e.$(".statistics-tab").show(),void(a&&"function"==typeof a&&a(!0));var s,c;(s="get_match_statistics",c={match_id:n},window.QueuedAjax&&"function"==typeof window.QueuedAjax.request?window.QueuedAjax.request(s,c).then(r):new Promise(function(e,t){jQuery.ajax({url:LiveScoresAjax.ajax_url,method:"POST",data:Object.assign({action:s,nonce:LiveScoresAjax.nonce},c),success:function(t){e(r(t))},error:function(e,n,i){t(new Error(i||n||"AJAX error"))}})})).then(function(n){const s=n&&n.statistics&&Array.isArray(n.statistics)&&n.statistics.length>0;if(s){if(JSON.stringify(n).length/1024>500&&i.optimizationSettings.compressLargeData){const e=p("Components")&&p("Components").Statistics;e&&"function"==typeof e.compressStatisticsData&&(n=e.compressStatisticsData(n))}const e=window.LiveScoreApp.Constants.getCacheTTL("STATISTICS","live");t.setToCacheByType(o,n,e,t.CACHE_PREFIX.STATISTIC)}e.$(".statistics-tab").toggle(s),a&&"function"==typeof a&&a(s)}).catch(function(e){a&&"function"==typeof a&&a(!1)})}function v(){if(a)return;a=!0,o.pageLoadTime=window.performance&&window.performance.timing?window.performance.timing.domContentLoadedEventEnd-window.performance.timing.navigationStart:0;const e=window.LiveScoreApp.Utils.TimerManager;e?e.setInterval(function(){const e=y();window.LiveScoreApp.debugMode,t&&"function"==typeof t.getCacheStats&&(e.cacheStats=t.getCacheStats()),window.performance&&window.performance.memory&&(e.memoryUsage.push({timestamp:Date.now(),usedJSHeapSize:window.performance.memory.usedJSHeapSize/1048576,totalJSHeapSize:window.performance.memory.totalJSHeapSize/1048576}),e.memoryUsage.length>10&&e.memoryUsage.shift())},36e5,"ui-performance-monitoring"):setInterval(function(){const e=y();window.LiveScoreApp.debugMode,t&&"function"==typeof t.getCacheStats&&(e.cacheStats=t.getCacheStats()),window.performance&&window.performance.memory&&(e.memoryUsage.push({timestamp:Date.now(),usedJSHeapSize:window.performance.memory.usedJSHeapSize/1048576,totalJSHeapSize:window.performance.memory.totalJSHeapSize/1048576}),e.memoryUsage.length>10&&e.memoryUsage.shift())},36e5)}function f(e,t){if(a)switch(e){case"userInteraction":o.interactionCount++,o.lastUserInteraction=Date.now(),o.lastInteractionType=t;break;case"dataLoaded":o.dataLoadEvents||(o.dataLoadEvents=[]),o.dataLoadEvents.push({type:t,timestamp:Date.now()}),o.dataLoadEvents.length>10&&o.dataLoadEvents.shift();break;default:o.customMetrics||(o.customMetrics={}),o.customMetrics[e]=t}}function y(){return Object.assign({},o)}function g(e,t){if("all"===e){const e=String(t.getDate()).padStart(2,"0"),n=String(t.getMonth()+1).padStart(2,"0"),i=t.getFullYear(),a=`${window.location.origin}/canli-skor/${e}/${n}/${i}/`;window.history.pushState({day:e,month:n,year:i,type:"all"},"",a)}else{const e=`${window.location.origin}/canli-skor`;window.history.pushState({type:"live"},"",e)}}return window.LiveScoreApp.formatNaturalDate=function(e,t,n){var i=window.translations&&window.translations.months||c;return parseInt(e)+" "+i[parseInt(t)-1]+" "+n},{setupEventListeners:function t(){const a=document.getElementById("all-matches"),o=document.getElementById("live-matches");a&&o?(window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.EventUtils&&"function"==typeof window.LiveScoreApp.Utils.EventUtils.setupMainAppEventListeners?window.LiveScoreApp.Utils.EventUtils.setupMainAppEventListeners({clearCacheSmart:d,onTabChange:m,onDateChange:u,updatePerformanceMetric:f}):function(){if(!s){if(e.$("#all-matches").off("click.ui-classic"),e.$("#live-matches").off("click.ui-classic"),e.$("#date-picker").off("change.ui-classic"),e.$("#all-matches").on("click.ui-classic",function(){e.$("#all-matches").addClass("active"),e.$("#live-matches").removeClass("active"),e.$(".switch-menu").removeClass("indicator-right"),e.$(".date-picker-container").addClass("visible"),e.$("#quick-date-bar").addClass("visible");const t=p("LiveScores");if(!t)return;t.setIsAllMatchesSelected(!0);const n=e.$("#date-picker").val().split("/");t.setIsSwitchingTab(!0),t.fetchLiveScores(n[0],n[1],n[2],"all"),d(["STANDING","JERSEY"]),m("all"),f("userInteraction","all-matches-click")}),e.$("#live-matches").on("click.ui-classic",function(){e.$("#live-matches").addClass("active"),e.$("#all-matches").removeClass("active"),e.$(".switch-menu").addClass("indicator-right"),e.$(".date-picker-container").removeClass("visible"),e.$("#quick-date-bar").removeClass("visible"),"function"==typeof window.resetLeagueFilter&&window.resetLeagueFilter();const t=p("LiveScores");t&&(t.setIsAllMatchesSelected(!1),t.setIsSwitchingTab(!0),t.fetchLiveScores(null,null,null,"live"),d(["STANDING","JERSEY"]),m("live"),f("userInteraction","live-matches-click"))}),"function"==typeof flatpickr)try{flatpickr("#date-picker",{dateFormat:"d/m/Y",defaultDate:"today",locale:flatpickr.l10ns.tr,onChange:function(t,n,i){if(!t||!t.length)return;var a=document.getElementById("quick-date-bar");a&&a.querySelectorAll(".qd-pill").forEach(function(e){e.getAttribute("data-date")===n?e.classList.add("qd-active"):e.classList.remove("qd-active")});if(!(t[0]instanceof Date)||isNaN(t[0].getTime()))return void(document.title="Canlı Skor - Maç Programı | Sporkolik");const o=n.split("/"),s=p("LiveScores");if(!s)return;const r=p("Modules")&&p("Modules").MetaTags;if(document.title="Maçlar Yükleniyor... - Canlı Skor",r&&"function"==typeof r.updateMetaTags)try{r.updateMetaTags("all",t[0])}catch(e){document.title=`Canlı Skor - ${window.LiveScoreApp.formatNaturalDate(o[0],o[1],o[2])} Maç Programı | Sporkolik`}s.setIsSwitchingTab(!0);const c=s.fetchLiveScores(o[0],o[1],o[2],"all");let l=`Tüm Maçlar - ${o[0]}/${o[1]}/${o[2]} Tarihi`;(function(){if("Maçlar Yükleniyor... - Canlı Skor"===document.title||"undefined"===document.title||document.title.includes("undefined")||""===document.title)if(r&&"function"==typeof r.updateMetaTags)try{r.updateMetaTags("all",t[0])}catch(e){document.title=l}else document.title=l})(),c.then(()=>{("Maçlar Yükleniyor... - Canlı Skor"===document.title||"undefined"===document.title||document.title.includes("undefined"))&&r&&"function"==typeof r.updateMetaTags&&r.updateMetaTags("all",t[0]),f("dataLoaded","date-change")}).catch(t=>{e.$("#live-scores").html("<p>Veriler yüklenirken bir hata oluştu. Lütfen tekrar deneyin.</p>"),("Maçlar Yükleniyor... - Canlı Skor"===document.title||"undefined"===document.title||document.title.includes("undefined"))&&(r&&"function"==typeof r.updateMetaTags?r.updateMetaTags("all",new Date):document.title="Canlı Skor - Maç Programı ve Sonuçları | Sporkolik")}),window.LiveScoreApp.hasHistoricalDataLoaded&&(window.LiveScoreApp.hasHistoricalDataLoaded=!1),u(t[0]),d(["LIVESCORE"])}})}catch(t){e.$("#date-picker").attr("type","date")}else e.$("#date-picker").attr("type","date");s=!0}}(),n&&"function"==typeof n.setupDomEventListeners&&n.setupDomEventListeners(),function(){var e=document.getElementById("quick-date-bar");if(e&&!(e.children.length>0)){var t=["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"],n=new Date;n.setHours(0,0,0,0);for(var i=-3;i<=3;i++){var a=new Date(n);a.setDate(a.getDate()+i);var o=document.createElement("button");o.type="button",o.className="qd-pill"+(0===i?" qd-active":""),o.setAttribute("data-date",r(a.getDate())+"/"+r(a.getMonth()+1)+"/"+a.getFullYear());var s;s=-1===i?"Dün":0===i?"Bugün":1===i?"Yarın":a.getDate()+" "+["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"][a.getMonth()],o.innerHTML=s+'<span class="qd-day">'+t[a.getDay()]+"</span>",e.appendChild(o)}e.addEventListener("click",function(t){var n=t.target.closest(".qd-pill");if(n){e.querySelectorAll(".qd-pill").forEach(function(e){e.classList.remove("qd-active")}),n.classList.add("qd-active");var i=n.getAttribute("data-date").split("/"),a=document.getElementById("date-picker");a&&a._flatpickr&&a._flatpickr.setDate(new Date(parseInt(i[2]),parseInt(i[1])-1,parseInt(i[0])),!0)}})}function r(e){return e<10?"0"+e:""+e}}(),function(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,n=localStorage.getItem("theme");("dark"===n||!n&&t)&&document.body.classList.add("dark-mode"),e.$(".theme-toggle").on("click",function(){document.body.classList.toggle("dark-mode");const e=document.body.classList.contains("dark-mode")?"dark":"light";localStorage.setItem("theme",e)})}(),i&&i.optimizationSettings&&i.optimizationSettings.logPerformanceStats&&v()):setTimeout(t,500)},cleanupClassicEventListeners:function(){s&&(e.$("#all-matches").off("click.ui-classic"),e.$("#live-matches").off("click.ui-classic"),e.$("#date-picker").off("change.ui-classic"),s=!1)},addTournamentFlag:function(e){n.addTournamentFlag(e)},attachMatchClickEvents:function(){n.attachMatchClickEvents({updatePerformanceMetric:f,checkAndFetchStatistics:w,cleanupOnScroll:h})},onTabChange:m,onDateChange:u,checkAndFetchStatistics:w,enablePerformanceMonitoring:v,getPerformanceStats:y,updateBrowserURL:g}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Modules=window.LiveScoreApp.Modules||{},window.LiveScoreApp.Modules.ScoreUpdater=function(){const e=window.LiveScoreApp.Config,t=window.LiveScoreApp.Utils.jQuery,n=window.LiveScoreApp.Utils.Translator,i=new Map,a=new Map,o=new Map,s=new Map,r=new Map,c=new Map,l=new Map,d=new Map;let p=null;function u(e,n,i){const a=(p&&p.length||(p=t.$("#score-aria-live"),p.length||(p=t.$('<div id="score-aria-live" aria-live="polite" aria-atomic="true" class="sr-only" style="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;"></div>'),t.$("body").append(p))),p),o="home"===n?i.find(".live-scores-team.home .live-scores-name").text().trim():i.find(".live-scores-team.away .live-scores-name").text().trim(),s=i.find(".live-scores-team.home .live-scores-score").text().trim(),r=i.find(".live-scores-team.away .live-scores-score").text().trim(),c="goal"===e?`Gol! ${o}. Skor: ${s} - ${r}`:`Gol iptal! ${o}. Skor: ${s} - ${r}`;a.text(c)}function m(e){if(a.has(e)){const t=a.get(e);for(const[e,n]of t)clearTimeout(n);a.delete(e)}}function h(e=6e5){const t=Date.now();let n=0;for(const[a,s]of i)t-s.lastUpdate>e&&(i.delete(a),m(a),o.has(a)&&o.delete(a),n++);if(i.size>400){const e=Array.from(i.entries()).sort((e,t)=>e[1].lastUpdate-t[1].lastUpdate),t=i.size-340;e.slice(0,t).forEach(([e])=>{i.delete(e),m(e),o.has(e)&&o.delete(e),n++})}for(const[i,a]of o)if(t-a.lastUpdate>e){o.delete(i);const e="home-"+i,t="away-"+i;s.has(e)&&s.delete(e),s.has(t)&&s.delete(t),n++}if(o.size>300){const e=Array.from(o.entries()).sort((e,t)=>e[1].lastUpdate-t[1].lastUpdate),t=o.size-255;e.slice(0,t).forEach(([e])=>{o.delete(e),n++})}for(const[i,a]of r)t-a>e&&(r.delete(i),n++);if(r.size>200){const e=Array.from(r.entries()).sort((e,t)=>e[1]-t[1]),t=r.size-170;e.slice(0,t).forEach(([e])=>{r.delete(e),n++})}for(const[e,t]of l)window.LiveScoreApp.LiveMatches.has(e)||(l.delete(e),n++);if(l.size>400){for(const[e]of l)window.LiveScoreApp.LiveMatches.has(e)||(l.delete(e),n++);if(l.size>400){const e=Array.from(l.keys()),t=l.size-340;for(let i=0;i<t&&e.length>0;i++){const t=Math.floor(Math.random()*e.length),i=e.splice(t,1)[0];l.delete(i),n++}}}for(const[i,a]of c)a.timestamp&&t-a.timestamp>e&&(c.delete(i),n++);for(const[i,a]of s)t-a>e&&(s.delete(i),n++);return n>10&&window.LiveScoreApp.debugMode,n}function w(e,t){return e.text().trim()!==t&&(e.text(t),!0)}function v(t,n,i,o){o||(o=t.hasClass("home")?"home":"away"),a.has(i)||a.set(i,new Map);const s=a.get(i);if(s.has(o)){if((t.hasClass("flash-goal")?"goal":t.hasClass("flash-cancel")?"cancel":null)===n)return;clearTimeout(s.get(o)),t.removeClass("flash-goal flash-cancel")}t[0].offsetWidth,t.addClass(`flash-${n}`);const c=setTimeout(()=>{if(t.removeClass(`flash-${n}`),a.has(i)){const e=a.get(i);e.delete(o),0===e.size&&a.delete(i)}},e.animationDurations.scoreFlash);s.set(o,c),r.set(o,Date.now())}function f(e){const t=e.data("match-id");if(!t)return;const n=window.LiveScoreApp.LiveMatches.get(t.toString());if(n&&n.homeScore&&n.awayScore&&(void 0!==n.homeScore.aggregated||void 0!==n.awayScore.aggregated||n.previousLegEventId)){let i=0;if(window.LiveScoreApp.Utils.calculateAggregatedWinner)i=window.LiveScoreApp.Utils.calculateAggregatedWinner(n);else{const e=void 0!==n.homeScore.aggregated?n.homeScore.aggregated:0,t=void 0!==n.awayScore.aggregated?n.awayScore.aggregated:0;e>t?i=1:t>e?i=2:void 0!==n.homeScore.penalties&&void 0!==n.awayScore.penalties&&(n.homeScore.penalties>n.awayScore.penalties?i=1:n.awayScore.penalties>n.homeScore.penalties&&(i=2))}e.attr("data-aggregated-winner-code",i),n.aggregatedWinnerCode=i,window.LiveScoreApp.LiveMatches.set(t.toString(),n),e.find(".qualified-icon").remove(),1===i?e.find(".live-scores-team.home .live-scores-name").append('<i class="fas fa-arrow-up qualified-icon" title="Tur Atlayan Takım"></i>'):2===i&&e.find(".live-scores-team.away .live-scores-name").append('<i class="fas fa-arrow-up qualified-icon" title="Tur Atlayan Takım"></i>')}}return{updateMatchStatus:function(t){window.LiveScoreApp.Utils.calculateAggregatedWinner;const n=t.data("status"),p=t.data("match-id");if(!p)return;const m=t.find(".live-scores-minute, .minute"),y=function(e){return l.get(e)||null}(p)||n;if(y!==n&&function(e,t){l.set(e,t)}(p,n),"notstarted"===n)t.find(".live-scores-team .live-scores-score").addClass("hidden"),w(m,"Başlamadı");else if("finished"===n)w(m,"Bitti");else if("postponed"===n)t.find(".live-scores-team .live-scores-score").addClass("hidden"),w(m,"Ertelendi");else if("delayed"===n)t.find(".live-scores-team .live-scores-score").addClass("hidden"),w(m,"Gecikme");else if("canceled"===n)t.find(".live-scores-team .live-scores-score").addClass("hidden"),w(m,"İptal");else{const e=window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.MinuteCalculator;if(e){const n=m.html()||"",i=e.getFormattedMinute(t),a=t.data("match-id"),o=n.replace(/\s+/g," ").trim(),s=i.replace(/\s+/g," ").trim();d.get(a),o!==s&&(m.addClass("updating"),setTimeout(()=>{m.html(i),m.removeClass("updating")},75),d.set(a,s))}else{let e=m.text().replace("'",""),n=parseInt(e);if(isNaN(n))""===e.trim()&&""!==(m.html()||"")&&m.html("");else{const e=t.data("status-description")||"";let i=null;switch(e){case"Halftime":i="İY";break;case"Extra time halftime":i="UZT İY";break;case"1nd extra":case"1st extra":case"Extra 1st half":case"2nd extra":case"Extra 2nd half":{const t=["1nd extra","1st extra","Extra 1st half"].includes(e)?"UZ1":"UZ2";i=n>15?t+" 15+'":t+" "+n+"'";break}case"Penalties":i="Pen";break;default:i="1st half"===e&&n>45?"45+'":"2nd half"===e&&n>90?"90+'":n+"'"}i&&m.html(i)}}}const g=t.find(".live-scores-team.home .live-scores-score"),S=t.find(".live-scores-team.away .live-scores-score");function A(e){const t=parseInt(e.trim(),10);return isNaN(t)?null:t}const L=A(g.text()),b=A(S.text());if(!i.has(p))return void i.set(p,{home:L,away:b,lastUpdate:Date.now()});const C=i.get(p),x=C.home,T=C.away,k=Date.now()-C.lastUpdate>3e5;function M(){i.set(p,{home:null!==L?L:C.home,away:null!==b?b:C.away,lastUpdate:Date.now()})}o.has(p)||o.set(p,{homeLast:[],awayLast:[],lastUpdate:Date.now()});const $=o.get(p);if(Date.now()-$.lastUpdate>3e5&&($.homeLast=[],$.awayLast=[]),null!==L&&($.homeLast.push(L),$.homeLast.length>3&&$.homeLast.shift()),null!==b&&($.awayLast.push(b),$.awayLast.length>3&&$.awayLast.shift()),$.lastUpdate=Date.now(),o.set(p,$),!k&&null!==L&&L!==x){const e=$.homeLast;if(e.length>0&&e[e.length-1]===L)M();else{M();const n=L-x;if(Math.abs(n)>2)return;let i=L>x;if(!i&&e.length>1){const t=x-L,n=Date.now(),o="home-"+p;if(e.length>=2&&e[e.length-1]<e[e.length-2]){const e=a.get(p);e&&e.has(o)&&(g.hasClass("flash-goal")||n-(r.get(o)||0)<5e3)?i=!0:s.set(o,n)}else t>1?i=!0:s.has(o)?(s.get(o),i=!0):i=!0}v(g,i?"goal":"cancel",p,"home"),u(i?"goal":"cancel","home",t)}}if(!k&&null!==b&&b!==T){const e=$.awayLast;if(e.length>0&&e[e.length-1]===b)L!==x&&null!==L||M();else{L!==x&&null!==L||M();const n=b-T;if(Math.abs(n)>2)return;let i=b>T;if(!i&&e.length>1){const t=T-b,n=Date.now(),o="away-"+p;if(e.length>=2&&e[e.length-1]<e[e.length-2]){const e=a.get(p);e&&e.has(o)&&(S.hasClass("flash-goal")||n-(r.get(o)||0)<5e3)?i=!0:s.set(o,n)}else t>1?i=!0:s.has(o)?(s.get(o),i=!0):i=!0}v(S,i?"goal":"cancel",p,"away"),u(i?"goal":"cancel","away",t)}}if(L!==x&&null!==L||b!==T&&null!==b||M(),f(t),Math.random()<.2){const t=e.optimizationSettings._dynamicInfo;h(t?Math.floor(18e4*t.appliedRetentionSpeed):12e4)}if(window.scoreUpdateCounter||(window.scoreUpdateCounter=0),window.scoreUpdateCounter++,window.scoreUpdateCounter%30==0){const t=e.optimizationSettings._dynamicInfo;h(t?Math.floor(12e4*t.appliedRetentionSpeed):9e4),window.scoreUpdateCounter=0;const n=Date.now(),i=t?Math.floor(3e5*t.appliedRetentionSpeed):24e4;for(const[e,t]of s)n-t>i&&s.delete(e)}i.size+o.size+r.size+l.size+c.size+s.size>1500&&(h(12e4),i.size,o.size,r.size,l.size,c.size,s.size)},flashScoreCard:v,getMatchData:function(e){return{homeTeamName:n.translateName("teams",e.find(".live-scores-team.home .live-scores-name").text()),homeTeamCountry:e.find(".live-scores-team.home .live-scores-team-country").text(),awayTeamName:n.translateName("teams",e.find(".live-scores-team.away .live-scores-name").text()),awayTeamCountry:e.find(".live-scores-team.away .live-scores-team-country").text(),homeTeamScore:e.find(".live-scores-team.home .live-scores-score").text(),awayTeamScore:e.find(".live-scores-team.away .live-scores-score").text(),matchTime:e.find(".live-scores-minute").text(),matchStatus:e.data("status"),homeTeamLogo:e.find(".live-scores-team.home .team-logo").attr("src"),awayTeamLogo:e.find(".live-scores-team.away .team-logo").attr("src"),homeRedCards:e.data("home-red-cards")||0,awayRedCards:e.data("away-red-cards")||0}},cleanupStaleScores:h,clearMatchAnimations:m,updateQualifiedTeam:f,_clearFormattedMinuteCache:function(e){d.has(e)&&d.delete(e)},emergencyCleanup:function(){const e=i.size,t=a.size,n=o.size,d=s.size,p=r.size,u=l.size;return i.clear(),a.clear(),o.clear(),s.clear(),r.clear(),l.clear(),c.clear(),{globalScores:e,animations:t,history:n,alerts:d,animationTimes:p,statusTracker:u}},getMapSizes:function(){return{globalScores:i.size,matchAnimations:a.size,scoreHistory:o.size,lastCancelAlert:s.size,lastAnimationTime:r.size,matchStatusTracker:l.size,animationQueue:c.size,total:i.size+a.size+o.size+s.size+r.size+l.size+c.size}}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Modules=window.LiveScoreApp.Modules||{},window.LiveScoreApp.Modules.MetaTags=function(){function e(e){try{e&&"string"==typeof e&&"undefined"!==e&&!e.includes("undefined")||(e="Canlı Skor"),window.tdLocalCache||(window.tdLocalCache={}),window.tdLocalCache.data||(window.tdLocalCache.data={}),window.tdLocalCache.data.page_title=e,window.td_data||(window.td_data={}),window.td_data.page_title=e,window.tdLocalCache&&window.tdLocalCache.data&&!window.tdLocalCache.data.td_data&&(window.tdLocalCache.data.td_data={}),window.tdLocalCache&&window.tdLocalCache.data&&window.tdLocalCache.data.td_data&&(window.tdLocalCache.data.td_data.page_title=e),document.title=e,("undefined"===document.title||document.title.includes("undefined"))&&(document.title=e)}catch(e){document.title="Canlı Skor"}}function t(e,t){const n=String(t.getDate()).padStart(2,"0"),i=String(t.getMonth()+1).padStart(2,"0"),a=t.getFullYear();let o;"live"===e?o=window.location.origin+"/canli-skor":"all"===e&&(o=`${window.location.origin}/canli-skor/${n}/${i}/${a}/`);let s=document.querySelector("link[rel='canonical']");s?s.setAttribute("href",o):(s=document.createElement("link"),s.setAttribute("rel","canonical"),s.setAttribute("href",o),document.head.appendChild(s))}return{updateMetaTags:function(n,i){try{if(!(i instanceof Date)||isNaN(i.getTime())){const i=new Date,a=String(i.getDate()).padStart(2,"0"),o=String(i.getMonth()+1).padStart(2,"0"),s=i.getFullYear(),r=window.LiveScoreApp.formatNaturalDate?window.LiveScoreApp.formatNaturalDate(a,o,s):`${a}.${o}.${s}`;document.title="live"===n?`Canlı Skor - ${r} Güncel Maç Sonuçları | Sporkolik`:"all"===n?`Canlı Skor - ${r} Maç Programı ve Sonuçları | Sporkolik`:"Canlı Skor - Futbol Maçları | Sporkolik";const c="live"===n?`${r} canlı skor, maç sonuçları ve istatistikleri. Tüm ligler ve maçlar Sporkolik'te.`:`${r} tarihli tüm futbol maçları, canlı skorlar ve detaylı istatistikler.`,l=document.querySelector("meta[name='description']");if(l)l.setAttribute("content",c);else{const e=document.createElement("meta");e.setAttribute("name","description"),e.setAttribute("content",c),document.head.appendChild(e)}return t(n,i),void e(document.title)}const a=String(i.getDate()).padStart(2,"0"),o=String(i.getMonth()+1).padStart(2,"0"),s=i.getFullYear(),r=window.LiveScoreApp.formatNaturalDate?window.LiveScoreApp.formatNaturalDate(a,o,s):`${a}.${o}.${s}`,c=new Date;c.setHours(0,0,0,0);const l=new Date(i);l.setHours(0,0,0,0);const d=l.getTime()>c.getTime();let p,u;"live"===n?(p=`Canlı Skor - ${r} Güncel Maç Sonuçları | Sporkolik`,u=`${r} canlı skor, maç sonuçları ve istatistikleri. Tüm ligler ve maçlar Sporkolik'te.`):"all"===n?d?(p=`${r} Futbol Maç Programı | Sporkolik`,u=`${r} tarihli futbol maç programı, fikstür ve başlama saatleri.`):(p=`${r} Futbol Maç Sonuçları | Sporkolik`,u=`${r} tarihli tüm futbol maçları, canlı skorlar ve detaylı istatistikler.`):(p=`Canlı Skor - ${r} Futbol Maçları | Sporkolik`,u=`${r} tarihli futbol maçları ve canlı skor bilgileri.`),document.title=p,document.title&&"undefined"!==document.title&&!document.title.includes("undefined")||(document.title=p);const m=document.querySelector("meta[name='description']");if(m)m.setAttribute("content",u);else{const e=document.createElement("meta");e.setAttribute("name","description"),e.setAttribute("content",u),document.head.appendChild(e)}t(n,i),function(e,t,n){try{const i=new Date,a=n&&n instanceof Date&&n.getDate()===i.getDate()&&n.getMonth()===i.getMonth()&&n.getFullYear()===i.getFullYear();let o;if("live"===t&&a)o="Canlı Skor - Güncel Futbol Maç Sonuçları";else{const e=String(n.getDate()).padStart(2,"0"),t=String(n.getMonth()+1).padStart(2,"0"),i=n.getFullYear(),a=window.LiveScoreApp.formatNaturalDate?window.LiveScoreApp.formatNaturalDate(e,t,i):`${e}.${t}.${i}`,s=new Date;s.setHours(0,0,0,0);const r=new Date(n);r.setHours(0,0,0,0),o=`${a} ${r.getTime()>s.getTime()?"Futbol Maç Programı":"Futbol Maç Sonuçları"}`}const s=document.querySelector(".live-scores-page-h1");s&&(s.textContent=o);let r=e;"live"===t?r=e.split(" Güncel")[0]:"all"===t&&(r=e.split(" Maç Programı")[0].replace("Canlı Skor","Tüm Maçlar"));const c=document.getElementById("live-scores-page-title");c&&(c.textContent=r)}catch(e){}}(p,n,i),e(p)}catch(t){const i=new Date,a=String(i.getDate()).padStart(2,"0"),o=String(i.getMonth()+1).padStart(2,"0"),s=i.getFullYear(),r=window.LiveScoreApp.formatNaturalDate?window.LiveScoreApp.formatNaturalDate(a,o,s):`${a}.${o}.${s}`,c="live"===n?`Canlı Skor - ${r} | Sporkolik`:`Canlı Skor - ${r} Maç Programı | Sporkolik`;document.title=c,e(c)}},updateCanonicalURL:t,updateMetaDescriptionForIncidents:function(e,t){if(!e||0===e.length||!t)return;const n=e.slice(0,3).map(function(e){const t="goal"===e.type?"⚽":"🟨";return e.minute+"' "+t+" "+(e.player||"Oyuncu")}).join(" • "),i=((t.homeTeam||"Ev Sahibi")+" vs "+(t.awayTeam||"Misafir")+" - "+n+" - Canlı maç detayları ve istatistikleri...").substring(0,160);let a=document.querySelector('meta[name="description"]');a?a.setAttribute("content",i):(a=document.createElement("meta"),a.setAttribute("name","description"),a.setAttribute("content",i),document.head.appendChild(a))}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Modules=window.LiveScoreApp.Modules||{},window.LiveScoreApp.Modules.SEO=function(){const e=window.LiveScoreApp.Utils.jQuery;function t(e,t){return window.QueuedAjax&&"function"==typeof window.QueuedAjax.request?window.QueuedAjax.request(e,t).then(n):new Promise(function(i,a){jQuery.ajax({url:LiveScoresAjax.ajax_url,method:"POST",data:Object.assign({action:e,nonce:LiveScoresAjax.nonce},t),success:function(e){i(n(e))},error:function(e,t,n){a(new Error(n||t||"AJAX error"))}})})}function n(e){return e&&"object"==typeof e&&e.hasOwnProperty("success")&&void 0!==e.data?e.data:e}function i(){t("get_super_lig_next_matches",{}).then(function(n){if(n&&n.events&&n.events.length>0){const e=n.events[0].roundInfo.round,t=n.events.filter(t=>t.roundInfo.round===e);localStorage.setItem("nextWeekMatches",JSON.stringify(t)),localStorage.setItem("nextWeekMatchesTime",Date.now().toString()),localStorage.setItem("nextWeekMatchesSource","superlig"),a(t,"superlig")}else localStorage.removeItem("nextWeekMatches"),localStorage.removeItem("nextWeekMatchesTime"),localStorage.removeItem("nextWeekMatchesSource"),function(){var n=localStorage.getItem("worldCupNextMatches"),i=localStorage.getItem("worldCupNextMatchesTime");if(n&&i&&Date.now()-parseInt(i,10)<1728e5){var o=JSON.parse(n),s=Date.now()/1e3,r=o.filter(function(e){return e.startTimestamp>s});if(r.length>0)return void a(r,"worldcup");localStorage.removeItem("worldCupNextMatches"),localStorage.removeItem("worldCupNextMatchesTime")}t("get_world_cup_next_matches",{}).then(function(t){if(t&&t.events&&t.events.length>0){var n=t.events.slice(0,10);localStorage.setItem("worldCupNextMatches",JSON.stringify(n)),localStorage.setItem("worldCupNextMatchesTime",Date.now().toString()),a(n,"worldcup")}else e.$("#next-week-matches-section").hide()}).catch(function(){})}()}).catch(function(){})}function a(t,n){const i=e.$("#next-week-matches-section");"worldcup"===n?i.find("h3").html("<strong>FIFA Dünya Kupası 2026'da yaklaşan maçlar</strong> ve maç saatleri"):i.find("h3").html("<strong>Gelecek hafta oynanacak süper lig maçları</strong> ve maç saatleri");let a="<ul>";t.forEach(function(e){const t=new Date(1e3*e.startTimestamp),n=t.toLocaleDateString("tr-TR",{day:"2-digit",month:"2-digit",year:"numeric"}),i=t.toLocaleDateString("tr-TR",{weekday:"long"}),o=t.getHours().toString().padStart(2,"0")+":"+t.getMinutes().toString().padStart(2,"0");a+=`<li>${e.homeTeam.name} vs ${e.awayTeam.name} - ${n} ${i} ${o}</li>`}),a+="</ul>",e.$("#next-week-matches").html(a)}return{appendSeoText:function(){if(!e.$("#seo-text").length){e.$("#live-scores").append('\n            <div id="seo-text" style="color: #6c757d; font-size: 14px; margin-top: 20px;">\n                <h2><strong>Canlı Skor</strong> ve Güncel Futbol Maç Sonuçları</h2>\n                <p>\n                    Futbol tutkunları için <strong>canlı skor</strong> takibi vazgeçilmezdir. Sitemizde, Türkiye Süper Lig başta olmak üzere Premier Lig, La Liga, Serie A ve Bundesliga gibi\n                    en popüler futbol liglerinin <strong>canlı skor</strong>larını anında takip edebilirsiniz. Güncel maç sonuçları, anlık skorlar ve takımların son durumları hakkında\n                    en doğru bilgileri buradan alabilirsiniz.\n                </p>\n                <p>\n                    <strong>Canlı skor</strong> servisimizi kullanarak maçların her anında yaşanan gelişmeleri öğrenebilir, gol bilgileri, kartlar ve oyuncu değişiklikleri gibi tüm olayları anlık olarak görebilirsiniz. Sitemizdeki <em>canlı skor</em> servisi, maçların başlamasından itibaren sürekli güncellenir ve sizlere en doğru sonuçları sunar.\n                </p>\n                <div id="next-week-matches-section">\n                    <h3><strong>Gelecek hafta oynanacak süper lig maçları</strong> ve maç saatleri</h3>\n                    <div id="next-week-matches"></div>\n                    <p>\n                        Yalnızca oynananacak maçlar değil, <strong>canlı skor ve canlı istatistik</strong> bilgileri de futbol severler için önemlidir. Hangi takımların karşılaşacağını, maç tarihlerini ve saatlerini sitemizden öğrenerek bir sonraki hafta için hazırlıklı olabilirsiniz. <em>Gelecek hafta maçları</em> ile ilgili güncel bilgilere ve analizlere buradan ulaşabilirsiniz.\n                    </p>\n                </div>\n                <p>\n                    Ayrıca, her takımın <em>maç kadroları</em> ve dizilişleri hakkında detaylı bilgilere de sitemizde ulaşabilirsiniz. Hangi oyuncuların sahada olacağını, sakat veya cezalı oyuncu durumlarını burada bulabilirsiniz.\n                </p>\n                <h3><strong>Canlı Skor</strong> ve Anlık Maç İstatistikleri</h3>\n                <p>\n                    <strong>Canlı skor</strong> servisi ile dünya futbolunu yakından takip edin. Özellikle <em>canlı maç sonuçları</em>, gol bilgileri ve maç içi istatistiklerle birlikte maçın tüm detaylarına sitemizden erişebilirsiniz.\n                    Maçları kaçırmamak için <strong>anlık skorlar</strong> ve maç takibi servisimize göz atmayı unutmayın. Her hafta, tüm futbol liglerinin en güncel bilgilerini buradan öğrenebilirsiniz.\n                </p>\n                <p>\n                    Futbolun heyecanını canlı tutmak için en önemli unsurlardan biri <strong>canlı skor</strong> takibidir. Hangi takımın öne geçtiğini, hangi oyuncunun gol attığını ve maçın gidişatını anbean öğrenmek istiyorsanız doğru yerdesiniz.\n                </p>\n            </div>');var t=localStorage.getItem("nextWeekMatches"),n=localStorage.getItem("nextWeekMatchesTime");if(t&&n&&Date.now()-parseInt(n,10)<1728e5){var o=JSON.parse(t),s=Date.now()/1e3,r=o.filter(function(e){return e.startTimestamp>s});0===r.length?(localStorage.removeItem("nextWeekMatches"),localStorage.removeItem("nextWeekMatchesTime"),localStorage.removeItem("nextWeekMatchesSource"),i()):a(r,localStorage.getItem("nextWeekMatchesSource")||"superlig")}else i()}},fetchSuperLigNextWeekMatches:i,displayMatchesInSeoText:a}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Modules=window.LiveScoreApp.Modules||{},window.LiveScoreApp.Modules.MatchDetailsTabs=function(){const e=window.LiveScoreApp.Utils.jQuery,t=(window.LiveScoreApp.Utils.RequestQueue,window.LiveScoreApp.Utils.Cache),n=(window.LiveScoreApp.Config,window.LiveScoreApp.Components||{});window.LiveScoreApp.Modules.MatchDetailsData;let i=null,a=null,o=null;function s(e,t){return window.QueuedAjax&&"function"==typeof window.QueuedAjax.request?window.QueuedAjax.request(e,t).then(r):new Promise(function(n,i){jQuery.ajax({url:LiveScoresAjax.ajax_url,method:"POST",data:Object.assign({action:e,nonce:LiveScoresAjax.nonce},t),success:function(e){n(r(e))},error:function(e,t,n){i(new Error(n||t||"AJAX error"))}})})}function r(e){return e&&"object"==typeof e&&e.hasOwnProperty("success")&&void 0!==e.data?e.data:e}function c(t,s){const r=window.LiveScoreApp.Modules.MatchDetails,c=r?r.getCurrentTab():null;var u,m;c!==s&&(m=s,function(t){if(t){switch(t){case"lineups":n?.Lineups?.stopRatingAutoUpdate&&n.Lineups.stopRatingAutoUpdate();break;case"details":a&&(clearInterval(a),a=null),i&&(clearInterval(i),i=null),e.$("#attack-momentum-chart, #match-incidents").removeClass("loading");break;case"standings":o&&(clearInterval(o),o=null),n?.Standings?.stopPolling&&n.Standings.stopPolling();break;case"statistics":n?.Statistics?.stopAutoUpdate&&n.Statistics.stopAutoUpdate()}"details"!==t&&function(t){const n=e.$("#tab-"+t);if(!n.length)return;const i=n.outerHeight();i>0&&n.css("min-height",i+"px"),n.empty(),n.attr("data-needs-reload","true")}(t)}}(u=c),function(t,n){const i=["details","lineups","statistics","standings","history"],a=(t?i.indexOf(t):-1)<i.indexOf(n)?"slide-right":"slide-left",o=t?e.$("#tab-"+t):null,s=e.$("#tab-"+n);o&&o.length&&(o.addClass("exiting "+a),setTimeout(()=>{o.removeClass("live-scores-active exiting "+a),o.css("display","none")},150)),s.css("display","block"),requestAnimationFrame(()=>{s.addClass("live-scores-active entering "+a),setTimeout(()=>{s.removeClass("entering "+a)},350)})}(u,m),r&&r.setCurrentTab(s),function(t,i){const a=e.$("#tab-"+i);switch("true"===a.attr("data-needs-reload")&&(a.css("min-height",""),a.removeAttr("data-needs-reload")),l(i)&&"details"!==i&&d(i),i){case"details":p(t);break;case"lineups":v(t);break;case"statistics":const i=e.$('.live-scores-match[data-match-id="'+t+'"]');f(t,i.length>0&&"finished"===i.data("status")),w(t);break;case"standings":g(t);break;case"history":e.$("#h2h-button").length||(e.$("#tab-history").html('<div class="history-buttons"><button id="performance-button">Performans</button><button id="h2h-button" class="active">H2H</button><button id="team-streaks-button">Takım Serileri</button><button id="h2h-streaks-button">H2H Serileri</button></div><div id="history-content"></div>'),function(t){e.$("#performance-button").on("click.matchDetails",function(){e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),n&&n.History&&n.History.fetchPerformanceData(t)}),e.$("#h2h-button").on("click.matchDetails",function(){if(e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),n&&n.H2H){const i="finished"===e.$('.live-scores-match[data-match-id="'+t+'"]').data("status");n.H2H.fetchH2HData(t,i)}}),e.$("#team-streaks-button").on("click.matchDetails",function(){e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),n&&n.Streaks&&n.Streaks.fetchTeamStreaksData(t)}),e.$("#h2h-streaks-button").on("click.matchDetails",function(){if(e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),n&&n.Streaks){const i="finished"===e.$('.live-scores-match[data-match-id="'+t+'"]').data("status");n.Streaks.fetchH2HStreaksData(t,i)}})}(t)),setTimeout(function(){e.$("#h2h-button").click()},0)}}(t,s))}function l(t){return e.$("#tab-"+t).is(":empty")||!e.$("#tab-"+t).children().not(".loading-spinner, .skeleton-match, .skeleton-pulse, .skeleton-pulse-slow").length}function d(t){const i={lineups:"getLineupSkeleton",standings:"getStandingsSkeleton",history:"getH2HSkeleton"}[t];let a='<div class="loading-spinner"></div>';n.Skeleton&&i&&"function"==typeof n.Skeleton[i]&&(a=n.Skeleton[i]()),e.$("#tab-"+t).html(a)}async function p(t){const i=e.$("#tab-details"),a="finished"===e.$('.live-scores-match[data-match-id="'+t+'"]').data("status"),o=window.LiveScoreApp?.currentMatchDetailsData?.[t],s=function(t){const n=window.LiveScoreApp?.Utils?.Cache;if(!n)return null;const i=`${t}_${e.$('.live-scores-match[data-match-id="'+t+'"]').data("tournament-id")}_attack_momentum`,a=n.getFromCacheByType(i,n.CACHE_PREFIX.MATCH_DETAIL);return a&&a.graphPoints&&Array.isArray(a.graphPoints)&&a.graphPoints.length>0?a:null}(t),r=function(e){const t=window.LiveScoreApp?.Utils?.Cache;if(!t)return null;const n=`${e}_incidents`,i=t.getFromCacheByType(n,t.CACHE_PREFIX.MATCH_DETAIL);return i&&Array.isArray(i)&&i.length>0?i:null}(t),c=s&&s.graphPoints&&s.graphPoints.length>0,l=r&&Array.isArray(r)&&r.length>0;if(c&&l)return e.$("#attack-momentum-chart, #match-incidents").css("display","block"),i.html('<div id="attack-momentum-chart" class="tab-section top-section"></div><div id="match-incidents" class="match-incidents tab-section bottom-section"></div>'),u(s),m(r),a||(n?.AttackMomentum?.setupAutoUpdate&&n.AttackMomentum.setupAutoUpdate(t,a,s.tournamentId),n?.MatchIncidents?.setupAutoUpdate&&n.MatchIncidents.setupAutoUpdate(t,a)),void h(0,{success:!0,fromCache:!0},{success:!0,fromCache:!0},o);let d="";d=n.Skeleton&&"function"==typeof n.Skeleton.getAttackMomentumSkeleton?n.Skeleton.getAttackMomentumSkeleton():'<div class="loading-spinner"></div>',i.html(d),i.addClass("loading"),e.$("#attack-momentum-chart, #match-incidents").css("display","block"),i.html('<div id="attack-momentum-chart" class="tab-section top-section"></div><div id="match-incidents" class="match-incidents tab-section bottom-section"></div>'),i.addClass("loading");try{let e,d;c?(u(s),!a&&n?.AttackMomentum?.setupAutoUpdate&&n.AttackMomentum.setupAutoUpdate(t,a,s.tournamentId),e=Promise.resolve({success:!0,fromCache:!0})):e=function(e,t){return n?.AttackMomentum?.updateAttackMomentumTab?n.AttackMomentum.updateAttackMomentumTab(e,t,e=>{}).then(e=>({success:e,type:"attack-momentum"})):Promise.resolve({success:!1,type:"attack-momentum"})}(t,a),l?(m(r),!a&&n?.MatchIncidents?.setupAutoUpdate&&n.MatchIncidents.setupAutoUpdate(t,a),d=Promise.resolve({success:!0,fromCache:!0})):d=function(e,t){return new Promise(i=>{n?.MatchIncidents?.updateMatchIncidentsTab?n.MatchIncidents.updateMatchIncidentsTab(e,t,e=>{i({success:e,type:"match-incidents"})}):i({success:!1,type:"match-incidents"})})}(t,a);Date.now();const[p,w]=await Promise.all([e,d]);Date.now(),h(0,p,w,o),i.removeClass("loading")}catch(e){i.removeClass("loading"),i.html("<p>Detay verileri yüklenirken bir hata oluştu.</p>")}}function u(e){const t=window.LiveScoreApp.Utils.jQuery;n?.AttackMomentum?.renderAttackMomentumChart&&(t.$("#attack-momentum-chart").show(),n.AttackMomentum.renderAttackMomentumChart(e.graphPoints,e.homeTeamLogo,e.awayTeamLogo,e.incidents||[],e.tournamentId,null,null))}function m(e){n?.MatchIncidents?.renderMatchIncidents&&n.MatchIncidents.renderMatchIncidents(e)}function h(t,n,i,a){let o=!0===a?.hasAttackMomentum,s=!0===a?.hasMatchIncidents;!o&&n?.success&&(o=!0),!s&&i?.success&&(s=!0);const r=e.$('.live-scores-menu-item[data-tab="details"]'),c=e.$("#tab-details");!1===o&&!1===s&&!1===n?.success&&!1===i?.success?(r.hide(),c.hide()):!o&&!s&&n&&i||(r.show(),c.show())}function w(t){const n=e.$('.live-scores-match[data-match-id="'+t+'"]'),i=n.length>0?n.data("status"):null,a=e.$('.live-scores-menu-item[data-tab="statistics"]'),o=e.$("#tab-statistics");"notstarted"===i?(a.hide(),o.hide()):(a.show(),o.show())}function v(t){const i=e.$("#tab-lineups");l("lineups")&&(d("lineups"),i.addClass("loading")),n?.Lineups?.updateLineupsTab&&(n.Lineups.updateLineupsTab(t),i.removeClass("loading"),n.Lineups.startRatingAutoUpdate&&setTimeout(()=>{n.Lineups.startRatingAutoUpdate(t)},2e3))}function f(t,i){const a=e.$("#tab-statistics");l("statistics")&&(d("statistics"),a.addClass("loading")),n.Statistics?.updateStatisticsTab?(n.Statistics.updateStatisticsTab(t,i),a.removeClass("loading")):n.Statistics?.loadModules?n.Statistics.loadModules().then(e=>{e&&n.Statistics.updateStatisticsTab?(n.Statistics.updateStatisticsTab(t,i),a.removeClass("loading")):(y("İstatistik modülleri yüklenemedi."),a.removeClass("loading"))}).catch(e=>{y("İstatistik yükleme hatası: "+e.message),a.removeClass("loading")}):function(t,n){const i=function(){const e=document.getElementsByTagName("script");for(let t=0;t<e.length;t++){const n=e[t].src;if(-1!==n.indexOf("/js/"))return n.substring(0,n.indexOf("/js/")+4)}return null}();if(!i)return void y("JavaScript dosya yolu bulunamadı.");const a=document.createElement("script");a.src=i+"components/statistics.js",a.async=!0,a.onload=()=>{setTimeout(()=>{window.LiveScoreApp.Components?.Statistics?f(t,n):y("İstatistik modülü doğru yüklenemedi.")},100)},a.onerror=()=>{y("İstatistik modülü yüklenemedi."),e.$("#tab-statistics").removeClass("loading")},document.head.appendChild(a)}(t,i)}function y(t){const n=e.$("#tab-statistics");n.html("<p>"+t+"</p>"),n.removeClass("loading")}function g(i){const a=e.$("#tab-standings");if(l("standings")&&(d("standings"),a.addClass("loading")),!1===window.LiveScoreApp.hasStandingsData){const n=e.$('.live-scores-match[data-match-id="'+i+'"]'),a=n.data("tournament-id"),o=n.data("season-id"),s=n.data("group-id")||0;if(!a||!o)return e.$(".standings-tab").hide(),void e.$("#tab-standings").empty();{const n=`standings_check_${a}_${o}_${s}`,i=t.getFromCacheByType(n,t.CACHE_PREFIX.STANDING);if(i&&!0===i.exists)window.LiveScoreApp.hasStandingsData=!0;else if(i&&!1===i.exists)return e.$(".standings-tab").hide(),void e.$("#tab-standings").empty()}}const o=e.$('.live-scores-match[data-match-id="'+i+'"]'),s=o.data("tournament-id"),r=o.data("season-id"),c=o.data("group-id")||0;if(!s||!r)return e.$(".standings-tab").hide(),void e.$("#tab-standings").empty();const p=`standings_check_${s}_${r}_${c}`,u=t.getFromCacheByType(p,t.CACHE_PREFIX.STANDING);if(u&&!1===u.exists)return window.LiveScoreApp.hasStandingsData=!1,e.$(".standings-tab").hide(),void e.$("#tab-standings").empty();u&&!0===u.exists&&(window.LiveScoreApp.hasStandingsData=!0),n?.Standings?.updateStandingsTab?(n.Standings.updateStandingsTab(i),a.removeClass("loading")):S(i)}function S(i){const a=e.$('.live-scores-match[data-match-id="'+i+'"]'),o=a.data("tournament-id"),r=a.data("season-id");if(!o||!r)return void e.$(".standings-tab").hide();if(n?.Standings?.checkAndFetchStandings)return void n.Standings.checkAndFetchStandings(i);const c=`standings_check_${o}_${r}_${a.data("group-id")||0}`,l=t.getFromCacheByType(c,t.CACHE_PREFIX.STANDING);l?e.$(".standings-tab").toggle(l.exists):e.$(".standings-tab").data("checking")||(e.$(".standings-tab").data("checking",!0),s("get_standings_data",{tournament_id:o,season_id:r,type:"total",match_status:a.length&&a.data("status")||""}).then(function(n){e.$(".standings-tab").removeData("checking");try{if(!n||204===n.status||!1===n.hasData||null===n.standings){e.$(".standings-tab").hide();const n=window.LiveScoreApp.Constants.getCacheTTL("STANDINGS","live"),i={exists:!1,timestamp:Date.now(),reason:"204_no_content"};return void t.setToCacheByType(c,i,n,t.CACHE_PREFIX.STANDING)}const i=n&&n.standings&&n.standings[0]&&n.standings[0].rows&&n.standings[0].rows.length>0;e.$(".standings-tab").toggle(i);const a={exists:i,timestamp:Date.now()},o=window.LiveScoreApp.Constants.getCacheTTL("STANDINGS","live");t.setToCacheByType(c,a,o,t.CACHE_PREFIX.STANDING)}catch(t){e.$(".standings-tab").hide()}}).catch(function(n){e.$(".standings-tab").removeData("checking"),e.$(".standings-tab").hide();const i=window.LiveScoreApp.Constants.getCacheTTL("STANDINGS","live"),a={exists:!1,timestamp:Date.now(),error:!0};t.setToCacheByType(c,a,i/3,t.CACHE_PREFIX.STANDING)}))}let A=null;return{updateTabContent:c,updateDetailsTab:p,updateLineupsTab:v,updateStatisticsTab:f,updateStandingsTab:g,checkAndFetchLineups:function(i){if(n?.Lineups?.checkAndFetchLineups)return void n.Lineups.checkAndFetchLineups(i);const a=e.$('.live-scores-match[data-match-id="'+i+'"]').data("status")||"notstarted",o=t.getFromCacheByType(i,t.CACHE_PREFIX.LINEUP);let r=3e5;"inprogress"===a||"interrupted"===a?r=6e4:"finished"===a&&(r=36e5);let c=!1;if(o){const t=o.timestamp||0;if(c=Date.now()-t<r,c)return void e.$(".lineups-tab").show()}e.$(".lineups-tab").data("checking")||(e.$(".lineups-tab").data("checking",!0),s("get_match_lineups",{match_id:i,match_status:a||""}).then(function(n){e.$(".lineups-tab").removeData("checking");try{if(!n||204===n.status||!1===n.hasData||null===n.data)return e.$(".lineups-tab").hide(),void window.LiveScoreApp.debugMode;let o=!1;if(n&&"object"==typeof n&&n.home&&n.away&&n.home.players&&n.away.players&&Array.isArray(n.home.players)&&Array.isArray(n.away.players)&&n.home.players.length>0&&n.away.players.length>0&&(o=!0),o){e.$(".lineups-tab").show();let o="lineups";"inprogress"===a||"interrupted"===a?o="lineups_live":"finished"===a&&(o="lineups_finished");const s={exists:!0,timestamp:Date.now(),match_status:a,home_count:n.home.players.length,away_count:n.away.players.length},r=window.LiveScoreApp.Constants.getCacheTTL("LINEUPS","live");t.setToCacheByType(i,s,r,t.CACHE_PREFIX.LINEUP),window.LiveScoreApp.debugMode}else e.$(".lineups-tab").hide(),window.LiveScoreApp.debugMode}catch(t){e.$(".lineups-tab").hide()}}).catch(function(t){e.$(".lineups-tab").removeData("checking"),e.$(".lineups-tab").hide(),window.LiveScoreApp.debugMode}))},checkAndFetchStandings:S,checkDetailsTabVisibility:h,checkStatisticsTabVisibility:w,cleanupIntervals:function(){clearInterval(a),clearInterval(i),o&&(clearInterval(o),o=null),n?.Standings?.stopPolling&&n.Standings.stopPolling(),n?.Lineups?.stopRatingAutoUpdate&&n.Lineups.stopRatingAutoUpdate(),n?.AttackMomentum?.cleanupIntervals&&n.AttackMomentum.cleanupIntervals(),n?.MatchIncidents?.cleanupIntervals&&n.MatchIncidents.cleanupIntervals()},setupTabSwipeGestures:function(){const t=window.LiveScoreApp.Utils.DeviceDetect;if(t&&!t.isTouchDevice())return;const n=document.getElementById("match-details");if(!n)return;A&&A.abort(),A=new AbortController;const i=A.signal,a=["details","lineups","statistics","standings","history"];let o=0,s=0,r=0,l=!1,d=!1;n.addEventListener("touchstart",function(e){e.touches.length>1||(o=e.touches[0].clientX,s=e.touches[0].clientY,r=Date.now(),l=!1,d=!1)},{passive:!0,signal:i}),n.addEventListener("touchmove",function(e){if(e.touches.length>1||d)return;const t=e.touches[0].clientX-o,n=Math.abs(e.touches[0].clientY-s),i=Math.abs(t);i>30*Math.min(window.devicePixelRatio||1,3)&&i>1.5*n&&(l=!0)},{passive:!0,signal:i}),n.addEventListener("touchend",function(t){if(!l||d)return;d=!0;const n=t.changedTouches[0].clientX-o,i=Date.now()-r,s=Math.abs(n),p=50*Math.min(window.devicePixelRatio||1,3),u=s/Math.max(1,i);if(s<p&&u<.3)return;const m=window.LiveScoreApp.Modules.MatchDetails,h=m?m.getCurrentTab():"details",w=a.filter(function(t){const n=e.$('.live-scores-menu-item[data-tab="'+t+'"]');return n.length&&n.is(":visible")}),v=w.indexOf(h);if(-1===v)return;let f;if(f=n<0?v+1:v-1,f<0||f>=w.length)return;const y=w[f],g=window.LiveScoreApp.LiveScores,S=g&&"function"==typeof g.getSelectedMatchId?g.getSelectedMatchId():null;S&&(c(S,y),e.$(".live-scores-menu-item").removeClass("active").attr("aria-selected","false"),e.$('.live-scores-menu-item[data-tab="'+y+'"]').addClass("active").attr("aria-selected","true"))},{passive:!0,signal:i})},cleanupTabSwipeGestures:function(){A&&(A.abort(),A=null)}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Modules=window.LiveScoreApp.Modules||{},window.LiveScoreApp.Modules.MatchDetailsData=function(){const e=window.LiveScoreApp.Modules.ScoreUpdater,t=window.LiveScoreApp.Utils.Cache;window.LiveScoreApp.Config;let n=window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.RequestQueue;const i=window.LiveScoreApp.Utils.jQuery,a=window.LiveScoreApp.Utils.Compression;let o=null,s=null;function r(){o=null,s=null;try{i.$("#attack-momentum-chart").length&&i.$("#attack-momentum-chart").css("display",""),i.$(".live-scores-tab-content").removeClass("live-scores-active entering exiting slide-left slide-right").css("display",""),i.$(".live-scores-menu-item").removeClass("active")}catch(e){}}function c(e,a,o){if(!a)return void o("N/A");const s=`matchDetail_previousScore_${e}`,r=t.getFromCacheByType(s,t.CACHE_PREFIX.MATCH_DETAIL);r?o(r):n.enqueue(function(){return i.ajax({url:LiveScoresAjax.ajax_url,type:"POST",data:{action:"get_match_details",match_id:a},success:function(e){let n="N/A";if(e.success&&e.data){const t=e.data;void 0!==t.homeTeamScore&&void 0!==t.awayTeamScore&&null!==t.homeTeamScore&&null!==t.awayTeamScore&&(n=t.homeTeamScore+" - "+t.awayTeamScore)}(n.includes("null")||"null - null"===n)&&(n="N/A");const i=window.LiveScoreApp.Constants.getCacheTTL("MATCH_INCIDENTS","finished");t.setToCacheByType(s,n,i,t.CACHE_PREFIX.MATCH_DETAIL),o(n)},error:function(e,t,n){o("N/A")}})})}return{resetPreviousValues:r,loadMatchDetails:function(t,n,i){r();const c=window.LiveScoreApp.Utils.Cache,l=`${c.CACHE_PREFIX.MATCH_DETAIL}matchDetail_previousScore_${t}`,d=`${c.CACHE_PREFIX.MATCH_DETAIL}matchDetail_aggregateScore_${t}`,p=`${c.CACHE_PREFIX.MATCH_DETAIL}matchDetail_penaltyScore_${t}`;"function"==typeof c.deleteCacheItem&&(c.deleteCacheItem(l),c.deleteCacheItem(d),c.deleteCacheItem(p));const u=e.getMatchData(n);u.matchId=t,u.matchStatus=n.data("status"),u.tournamentId=n.data("tournament-id"),u.seasonId=n.data("season-id"),u.groupId=n.data("group-id")||0,u.tournamentName=n.parents(".live-scores-tournament-card").find(".live-scores-tournament-title").text(),u.homeTeamId=n.data("home-team-id"),u.awayTeamId=n.data("away-team-id"),u.aggregatedWinnerCode=n.data("aggregated-winner-code")||0;try{if(c&&"function"==typeof c.getFromCacheByType&&c.CACHE_PREFIX){const e=`matchDetail_aggregateScore_${t}`,n=c.getFromCacheByType(e,c.CACHE_PREFIX.MATCH_DETAIL);n&&void 0!==n.homeScore&&void 0!==n.awayScore&&(u.homeAggregatedScore=n.homeScore,u.awayAggregatedScore=n.awayScore);const i=`matchDetail_previousScore_${t}`,a=c.getFromCacheByType(i,c.CACHE_PREFIX.MATCH_DETAIL);a&&a.score&&(o=a.eventId,s=a.score,u.previousScore=a.score,u.previousLegEventId=a.eventId);const r=`matchDetail_penaltyScore_${t}`,l=c.getFromCacheByType(r,c.CACHE_PREFIX.MATCH_DETAIL);l&&void 0!==l.homeScore&&void 0!==l.awayScore&&(u.homePenaltiesScore=l.homeScore,u.awayPenaltiesScore=l.awayScore)}}catch(e){}const m=`matchDetail_${t}`;i(a.getOptimizedCache(m,c.CACHE_PREFIX.MATCH_DETAIL)||null,u)},fetchMatchDetailsFromServer:function e(r,l){const d=window.LiveScoreApp.Utils.RequestIdGenerator,p=d?d.generateId(r,"get_match_details"):null,u=(n||(n=window.LiveScoreApp.Utils.RequestQueue),!n&&window.LiveScoreApp&&window.LiveScoreApp.Utils&&(window.LiveScoreApp.Utils.RequestQueue={enqueue:function(e){if(!e||"function"!=typeof e)return Promise.reject(new Error("Invalid request function"));try{const t=e();return t&&t.then,Promise.resolve(t)}catch(e){return Promise.reject(e)}},add:function(e){if(!e||"function"!=typeof e.execute)return Promise.reject(new Error("Invalid request"));try{return e.execute(function(t){e.callback&&e.callback(t)}),Promise.resolve()}catch(t){return e.errorCallback&&e.errorCallback(t),Promise.reject(t)}},clearQueue:function(){}},n=window.LiveScoreApp.Utils.RequestQueue),n);if(!u||"function"!=typeof u.enqueue){return(e._retryCount=(e._retryCount||0)+1)<30?void setTimeout(()=>{e(r,l)},100):(e._retryCount=0,i.ajax({url:LiveScoresAjax.ajax_url,type:"POST",data:{action:"get_match_details",match_id:r,request_id:p},success:l,error:function(e){l&&l({error:!0})}}))}e._retryCount=0,i.ajax({url:LiveScoresAjax.ajax_url,type:"POST",data:{action:"get_match_details",match_id:r,request_id:p},success:function(e){if(window.LiveScoreApp.DetailClosingFlags&&window.LiveScoreApp.DetailClosingFlags.isClosing(r))return;if(window.LiveScoreApp.detailClosing)return;if((window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null)!==r)return;const n=e&&e.data&&e.data.request_id||e.request_id;if(!p||d.validateResponse(r,n))if(e.success){var u=e.data;if(null!==u.previousLegEventId?(o=u.previousLegEventId,c(r,u.previousLegEventId,function(n){if(!(window.LiveScoreApp.DetailClosingFlags&&window.LiveScoreApp.DetailClosingFlags.isClosing(r)||window.LiveScoreApp.detailClosing||(window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null)!==r)){if(s=n,u.previousScore=n,n&&"N/A"!==n){const e=window.LiveScoreApp.Constants.getCacheTTL("MATCH_INCIDENTS","live");t.setToCacheByType(`matchDetail_previousScore_${r}`,{score:n,eventId:u.previousLegEventId},e,t.CACHE_PREFIX.MATCH_DETAIL)}l&&l(e)}})):l&&l(e),void 0!==u.aggregatedWinnerCode&&window.LiveScoreApp.LiveMatches&&window.LiveScoreApp.LiveMatches.has(r.toString())){const e=window.LiveScoreApp.LiveMatches.get(r.toString());e.aggregatedWinnerCode=u.aggregatedWinnerCode,window.LiveScoreApp.LiveMatches.set(r.toString(),e)}if(null!==u.homeAggregatedScore&&null!==u.awayAggregatedScore){const e=window.LiveScoreApp.Constants.getCacheTTL("MATCH_INCIDENTS","live");t.setToCacheByType(`matchDetail_aggregateScore_${r}`,{homeScore:u.homeAggregatedScore,awayScore:u.awayAggregatedScore},e,t.CACHE_PREFIX.MATCH_DETAIL)}if(null!==u.homePenaltiesScore&&null!==u.awayPenaltiesScore&&void 0!==u.homePenaltiesScore&&void 0!==u.awayPenaltiesScore){const e=window.LiveScoreApp.Constants.getCacheTTL("MATCH_INCIDENTS","live");t.setToCacheByType(`matchDetail_penaltyScore_${r}`,{homeScore:u.homePenaltiesScore,awayScore:u.awayPenaltiesScore},e,t.CACHE_PREFIX.MATCH_DETAIL)}const n=window.LiveScoreApp.Constants.getCacheTTL("LINEUPS","live"),d=i.$("#match-details").html();a.setOptimizedCache(`matchDetail_${r}`,d,n,t.CACHE_PREFIX.MATCH_DETAIL)}else{const e=window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null;if(e&&e!==r)return;l&&l(null)}else window.LiveScoreApp&&window.LiveScoreApp.Monitoring&&window.LiveScoreApp.Monitoring.trackCacheWriteFailure({endpoint:"match_details",matchId:r,reason:"request_id_mismatch",expected_id:p,received_id:e.request_id,timestamp:(new Date).toISOString()})},error:function(e,t,n){const i=window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null;i&&i!==r||l&&l(null)}})},fetchPreviousLegScore:c,clearTabCache:function(e,n=!1){const i=`${t.CACHE_PREFIX.MATCH_DETAIL}matchDetail_${e}`,a=`${t.CACHE_PREFIX.LINEUP}${e}`,r=`${t.CACHE_PREFIX.STATISTIC}${e}`,c=`${t.CACHE_PREFIX.STANDING}standings_check_${e}`;t.deleteCacheItem(i),t.deleteCacheItem(a),t.deleteCacheItem(r),t.deleteCacheItem(c);const l=["ALL","1ST","2ND"];for(const n of l){const i=`${t.CACHE_PREFIX.STATISTIC}${e}_${n}`;t.deleteCacheItem(i)}if(window.LiveScoreApp.debugMode,n){const n=`${t.CACHE_PREFIX.MATCH_DETAIL}matchDetail_previousScore_${e}`,i=`${t.CACHE_PREFIX.MATCH_DETAIL}matchDetail_aggregateScore_${e}`,a=`${t.CACHE_PREFIX.MATCH_DETAIL}matchDetail_penaltyScore_${e}`;t.deleteCacheItem(n),t.deleteCacheItem(i),t.deleteCacheItem(a),window.LiveScoreApp.debugMode,o=null,s=null}},hasValidAttackMomentumData:function(e){const n=`${e}`,i=t.getFromCacheByType(n,t.CACHE_PREFIX.GENERAL);return i&&i.graphPoints&&Array.isArray(i.graphPoints)&&i.graphPoints.length>0},getPreviousLegEventId:function(){return o},getPreviousScore:function(){return s}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Modules=window.LiveScoreApp.Modules||{},window.LiveScoreApp.Modules.MatchDetailsEvents=function(){const e=window.LiveScoreApp.Utils.jQuery,t=(window.LiveScoreApp.Utils.EventUtils,window.LiveScoreApp.Components||{});function n(e){window.LiveScoreApp._closeMatchDetailsLogs||(window.LiveScoreApp._closeMatchDetailsLogs=[]),window.LiveScoreApp._closeMatchDetailsLogs.push(e),window.LiveScoreApp._closeMatchDetailsLogs.length>100&&window.LiveScoreApp._closeMatchDetailsLogs.shift()}function i(){const t=document.getElementById("match-details");t&&(t.style.opacity="1",t.style.transform="translateY(0)",t.classList.remove("swiping")),window.LiveScoreApp.Modules.MatchDetailsTabs&&"function"==typeof window.LiveScoreApp.Modules.MatchDetailsTabs.cleanupTabSwipeGestures&&window.LiveScoreApp.Modules.MatchDetailsTabs.cleanupTabSwipeGestures(),e.$(".live-scores-back-button").off("click.matchDetails"),e.$(".live-scores-back-button").off("click"),e.$(document).off("click","#match-details .live-scores-back-button"),window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.EventUtils&&"function"==typeof window.LiveScoreApp.Utils.EventUtils.cleanupMatchDetailsEventListeners?window.LiveScoreApp.Utils.EventUtils.cleanupMatchDetailsEventListeners():(e.$(".live-scores-menu-item").off("click.matchDetails"),e.$(".live-scores-back-button").off("click.matchDetails"),e.$("#performance-button").off("click.matchDetails"),e.$("#h2h-button").off("click.matchDetails"),e.$("#team-streaks-button").off("click.matchDetails"),e.$("#h2h-streaks-button").off("click.matchDetails"),e.$(document).off("keydown.matchDetails"))}function a(){const e=window.LiveScoreApp?.Modules?.MatchDetails;e&&"function"==typeof e.closeMatchDetails?e.closeMatchDetails():window.LiveScoreApp.Utils.jQuery.$("#match-details").hide()}return{setupEventListeners:function(o){const s=Date.now();n(`[${s}] MatchDetailsEvents.setupEventListeners() STARTED for matchId=${o}`),n(`[${s}] Calling cleanupEventListeners()`);try{i(),n(`[${s}] cleanupEventListeners() succeeded`)}catch(e){n(`[${s}] ERROR in cleanupEventListeners(): ${e.message}`)}if(n(`[${s}] Removing old back button handlers`),e.$(".live-scores-back-button").off("click"),e.$(".live-scores-back-button").off("click.matchDetails"),e.$(document).off("click","#match-details .live-scores-back-button"),window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.EventUtils&&"function"==typeof window.LiveScoreApp.Utils.EventUtils.setupMatchDetailsEventListeners){n(`[${s}] EventUtils.setupMatchDetailsEventListeners() available, calling it`);try{window.LiveScoreApp.Utils.EventUtils.setupMatchDetailsEventListeners(o,{closeMatchDetails:a}),n(`[${s}] EventUtils.setupMatchDetailsEventListeners() returned successfully`)}catch(e){n(`[${s}] ERROR in EventUtils.setupMatchDetailsEventListeners(): ${e.message}`)}}else{n(`[${s}] WARNING: EventUtils.setupMatchDetailsEventListeners NOT available, using fallback`);try{!function(n){i(),e.$(".live-scores-menu-item").on("click.matchDetails",function(){const t=e.$(this).data("tab"),i=window.LiveScoreApp.Modules.MatchDetails;(i?i.getCurrentTab():null)!==t&&(e.$(".live-scores-menu-item").removeClass("active"),e.$(this).addClass("active"),e.$(".live-scores-tab-content").removeClass("live-scores-active entering exiting slide-left slide-right").css("display",""),e.$("#tab-"+t).addClass("live-scores-active"),i&&"function"==typeof i.updateTabContent?i.updateTabContent(n,t):window.LiveScoreApp.Modules.MatchDetailsTabs&&"function"==typeof window.LiveScoreApp.Modules.MatchDetailsTabs.updateTabContent&&window.LiveScoreApp.Modules.MatchDetailsTabs.updateTabContent(n,t))}),e.$(".live-scores-back-button").on("click.matchDetails",function(e){e.preventDefault(),e.stopPropagation(),window.LiveScoreApp.Modules.MatchDetailsData&&"function"==typeof window.LiveScoreApp.Modules.MatchDetailsData.resetPreviousValues&&window.LiveScoreApp.Modules.MatchDetailsData.resetPreviousValues(),a()}),e.$(".live-scores-back-button").on("touchstart.matchDetails",function(t){e.$(this).addClass("touch-active")}),e.$(".live-scores-back-button").on("touchend.matchDetails",function(t){e.$(this).removeClass("touch-active"),t.preventDefault(),t.stopPropagation(),window.LiveScoreApp.Modules.MatchDetailsData&&"function"==typeof window.LiveScoreApp.Modules.MatchDetailsData.resetPreviousValues&&window.LiveScoreApp.Modules.MatchDetailsData.resetPreviousValues(),a()}),e.$("#performance-button").on("click.matchDetails",function(){e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),t&&t.History&&t.History.fetchPerformanceData(n)}),e.$("#h2h-button").on("click.matchDetails",function(){if(e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),t&&t.H2H){const i="finished"===e.$('.live-scores-match[data-match-id="'+n+'"]').data("status");t.H2H.fetchH2HData(n,i)}}),e.$("#team-streaks-button").on("click.matchDetails",function(){e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),t&&t.Streaks&&t.Streaks.fetchTeamStreaksData(n)}),e.$("#h2h-streaks-button").on("click.matchDetails",function(){if(e.$(".history-buttons button").removeClass("active"),e.$(this).addClass("active"),t&&t.Streaks){const i="finished"===e.$('.live-scores-match[data-match-id="'+n+'"]').data("status");t.Streaks.fetchH2HStreaksData(n,i)}}),e.$(document).on("keydown.matchDetails",function(e){27===e.keyCode&&a()})}(o),n(`[${s}] setupClassicEventListeners() completed`)}catch(e){n(`[${s}] ERROR in setupClassicEventListeners(): ${e.message}`)}}n(`[${s}] MatchDetailsEvents.setupEventListeners() COMPLETED`),window.LiveScoreApp.Modules.MatchDetailsTabs&&"function"==typeof window.LiveScoreApp.Modules.MatchDetailsTabs.setupTabSwipeGestures&&window.LiveScoreApp.Modules.MatchDetailsTabs.setupTabSwipeGestures()},cleanupEventListeners:i,closeMatchDetails:a}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Modules=window.LiveScoreApp.Modules||{},window.LiveScoreApp.Modules.MatchDetailsUI=function(){const e=window.LiveScoreApp.Utils.DomUtils,t=(window.LiveScoreApp.Utils.Translator,window.LiveScoreApp.Utils.jQuery),n=(window.LiveScoreApp.Config,window.LiveScoreApp.Utils.Cache),i=(window.LiveScoreApp.Components&&window.LiveScoreApp.Components.Skeleton,window.LiveScoreApp.Utils.MinuteCalculator),a=window.LiveScoreApp.Utils.SecurityUtils;function o(e){if(!e||"string"!=typeof e)return e;const t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#x2F;":"/","&#47;":"/"};return e.replace(/&amp;|&lt;|&gt;|&quot;|&#39;|&#x2F;|&#47;/g,function(e){return t[e]})}return{generateMatchDetailsHTML:function(e){const t=a&&"function"==typeof a.validateMatchData?a.validateMatchData(e):e;let n="";if("inprogress"!==e.matchStatus||e.matchTime&&""!==e.matchTime.trim()){if(e.matchTime)if(e.matchTime.includes('<span class="match-status'))n=e.matchTime;else if(i){const t="finished"===e.matchStatus?"finished":"notstarted"===e.matchStatus?"notstarted":"inprogress"===e.matchStatus?"Started":"";n=i.formatMinute(e.matchTime,t)}else{let t="";e.matchTime.includes("UZT1")||e.matchTime.includes("UZT2")?t=' <span class="blinking-quote">\'</span>':e.matchTime.match(/Bitti|Başlamadı|Ertelendi|Gecikme/)||(t='<span class="blinking-quote">\'</span>'),n=e.matchTime.replace("'","")+t}}else n="";let s="",r="";e.homeRedCards>0&&(s=1===e.homeRedCards?' <i class="fas fa-square red-card-icon"></i>':' <i class="fas fa-square red-card-icon"></i> x'+e.homeRedCards),e.awayRedCards>0&&(r=1===e.awayRedCards?' <i class="fas fa-square red-card-icon"></i>':' <i class="fas fa-square red-card-icon"></i> x'+e.awayRedCards);let c="",l="";1===e.aggregatedWinnerCode?c=' <span class="md-qualified" title="Tur Atlayan Takım">✓</span>':2===e.aggregatedWinnerCode&&(l=' <span class="md-qualified" title="Tur Atlayan Takım">✓</span>');const d=window.LiveScoreApp.Components.Standings;let p=null,u=null;if(e.tournamentId&&e.seasonId){const t=`standings_check_${e.tournamentId}_${e.seasonId}_${e.groupId||0}`,n=window.LiveScoreApp.Utils.Cache.getFromCacheByType(t,window.LiveScoreApp.Utils.Cache.CACHE_PREFIX.STANDING);if(n&&!0===n.exists){const t=["knockout","final","qualification","playoff","play-off","eleme","elemeler","group stage","group","grup","kupa","kupası","cup","çeyrek","çeyrek final","quarter","yarifinal","yarı final","semi","round of","preliminary","ön eleme"];let n=!0;if(e.tournamentName){const i=e.tournamentName.toLowerCase();for(let e=0;e<t.length;e++)if(i.includes(t[e])){n=!1;break}}if(n){const t=`standings_${e.tournamentId}_${e.seasonId}_total${e.groupId?"_"+e.groupId:""}`,n=window.LiveScoreApp.Utils.Cache.getFromCacheByType(t,window.LiveScoreApp.Utils.Cache.CACHE_PREFIX.STANDING);if(n&&n.rows&&n.rows.length>0)for(let t=0;t<n.rows.length;t++)n.rows[t].team&&n.rows[t].team.id==e.homeTeamId&&(p=n.rows[t].position),n.rows[t].team&&n.rows[t].team.id==e.awayTeamId&&(u=n.rows[t].position)}}}let m=o(t.homeTeamName),h=o(t.awayTeamName);if(d&&"function"==typeof d.getTeamPosition&&e.tournamentId&&e.seasonId){const t=`standings_check_${e.tournamentId}_${e.seasonId}_${e.groupId||0}`,n=window.LiveScoreApp.Utils.Cache.getFromCacheByType(t,window.LiveScoreApp.Utils.Cache.CACHE_PREFIX.STANDING);if(n&&!0===n.exists){const t=["knockout","final","qualification","playoff","play-off","eleme","elemeler","group stage","group","grup","kupa","kupası","cup","çeyrek","çeyrek final","quarter","yarifinal","yarı final","semi","round of","preliminary","ön eleme"];let n=!0;if(e.tournamentName){const i=e.tournamentName.toLowerCase();for(let e=0;e<t.length;e++)if(i.includes(t[e])){n=!1;break}}if(n){const t=`standings_${e.tournamentId}_${e.seasonId}_total${e.groupId?"_"+e.groupId:""}`,n=window.LiveScoreApp.Utils.Cache.getFromCacheByType(t,window.LiveScoreApp.Utils.Cache.CACHE_PREFIX.STANDING);if(n&&n.rows&&n.rows.length>0)for(let t=0;t<n.rows.length;t++)n.rows[t].team.id==e.homeTeamId&&(p=n.rows[t].position),n.rows[t].team.id==e.awayTeamId&&(u=n.rows[t].position)}}}null!==p&&(m=`${m} (${p})`),null!==u&&(h=`${h} (${u})`);let w=void 0!==e.homeTeamDisplayScore?e.homeTeamDisplayScore:e.homeTeamScore,v=void 0!==e.awayTeamDisplayScore?e.awayTeamDisplayScore:e.awayTeamScore;const f=window.LiveScoreApp.LiveMatches?window.LiveScoreApp.LiveMatches.get(String(e.matchId||e.id||"")):null,y=f&&f.homeScore?f.homeScore.penalties:null,g=f&&f.awayScore?f.awayScore.penalties:null,S=null!=e.homePenaltiesScore?e.homePenaltiesScore:y,A=null!=e.awayPenaltiesScore?e.awayPenaltiesScore:g,L=null!=S&&null!=A,b=String(e.matchStatus||e.status&&e.status.type||f&&f.status&&f.status.type||"").toLowerCase(),C=Number(e.statusCode||e.matchStatusCode||e.status&&e.status.code||f&&f.status&&f.status.code||0),x=String(e.statusDescription||e.status&&e.status.description||f&&f.status&&f.status.description||e.matchTime||"").toUpperCase(),T=L&&("finished"===b||"afterpenalties"===b||120===C||x.includes("AP")||x.includes("BİTTİ")||x.includes("BITTI"));T&&(w=S,v=A);let k="";const M=[];if(e.homeScore&&"object"==typeof e.homeScore&&e.awayScore&&"object"==typeof e.awayScore){if(void 0!==e.homeScore.aggregated&&void 0!==e.awayScore.aggregated&&null!==e.homeScore.aggregated&&null!==e.awayScore.aggregated){const t=e.homeScore.aggregated+"-"+e.awayScore.aggregated;M.push(`<span class="aggregate-ims" title="Toplam Skor (Iki Aşamalı)"><strong>İMS:</strong> ${t}</span>`)}if(void 0!==e.homeScore.penalties&&void 0!==e.awayScore.penalties&&null!==e.homeScore.penalties&&null!==e.awayScore.penalties){const t=e.homeScore.penalties+"-"+e.awayScore.penalties;M.push(`<span class="aggregate-penalty" title="Penaltı Ataması"><strong>Pen:</strong> ${t}</span>`)}}M.length>0&&(k=M.join(" "));let $="";return L&&!T&&($=`<span class="aggregate-penalty" title="Penaltı Atışı"><strong>Pen:</strong> ${S}-${A}</span>`),`\n            <div class="md-hero${"inprogress"===e.matchStatus?" md-hero--live":""}">\n                <div class="md-hero__topbar">\n                    <button class="md-hero__btn live-scores-back-button" aria-label="Geri Git">\n                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M19 12H5"/><polyline points="12 19 5 12 12 5"/></svg>\n                    </button>\n                    <div class="md-hero__tournament">\n                        ${e.tournamentName?'<span class="md-hero__tournament-name">'+e.tournamentName+"</span>":""}\n                    </div>\n                    <a class="md-hero__btn match-detail-expand-btn" href="#" id="match-detail-expand" aria-label="Maç Sayfasını Aç" title="Maç Sayfasını Aç">\n                        <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>\n                    </a>\n                </div>\n                <h1 class="sr-only" id="match-detail-heading">${m} vs ${h} Maç Detayları</h1>\n                <div class="md-hero__scoreboard">\n                    <div class="md-hero__team md-hero__team--home">\n                        <div class="md-hero__logo">\n                            <img src="${e.homeTeamLogo}" alt="${m}" width="52" height="52">\n                        </div>\n                        <span class="md-hero__name" title="${m}">${m}${c}${s}</span>\n                    </div>\n                    <div class="md-hero__center">\n                        <div class="md-hero__score">\n                            <span class="md-hero__score-num">${w}</span>\n                            <span class="md-hero__score-sep">-</span>\n                            <span class="md-hero__score-num">${v}</span>\n                        </div>\n                        ${k||$?'<div class="md-hero__extra">'+(k||"")+($||"")+"</div>":""}\n                        <div class="md-hero__status">\n                            <div class="live-scores-match-time">${n}</div>\n                            <div class="previous-leg-score"></div>\n                        </div>\n                    </div>\n                    <div class="md-hero__team md-hero__team--away">\n                        <div class="md-hero__logo">\n                            <img src="${e.awayTeamLogo}" alt="${h}" width="52" height="52">\n                        </div>\n                        <span class="md-hero__name" title="${h}">${h}${l}${r}</span>\n                    </div>\n                </div>\n                <a class="md-hero__cta" href="#" id="match-detail-expand-cta" aria-label="Detaylı Maç Sayfası">\n                    <span>Detaylı Maç Sayfası</span>\n                    <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><polyline points="12 5 19 12 12 19"/></svg>\n                </a>\n            </div>\n            <div class="live-scores-match-detail-content">\n                <nav class="live-scores-menu" role="tablist" aria-label="Maç Detayları Seçenekleri" aria-labelledby="match-detail-heading">\n                    <button class="live-scores-menu-item" role="tab" aria-selected="true" aria-controls="tab-details" id="tab-details-button" data-tab="details">Ayrıntılar</button>\n                    <button class="live-scores-menu-item lineups-tab" role="tab" aria-selected="false" aria-controls="tab-lineups" id="tab-lineups-button" data-tab="lineups">Kadrolar</button>\n                    <button class="live-scores-menu-item statistics-tab" role="tab" aria-selected="false" aria-controls="tab-statistics" id="tab-statistics-button" data-tab="statistics">İstatistik</button>\n                    <button class="live-scores-menu-item standings-tab" role="tab" aria-selected="false" aria-controls="tab-standings" id="tab-standings-button" data-tab="standings">Puan Durumu</button>\n                    <button class="live-scores-menu-item history-tab" role="tab" aria-selected="false" aria-controls="tab-history" id="tab-history-button" data-tab="history">Geçmiş</button>\n                </nav>\n                <div id="tab-details" class="live-scores-tab-content" style="display:none;">\n                    <div id="attack-momentum-chart" style="display:none;"><canvas id="momentumChart"></canvas></div>\n                    <div id="match-incidents"></div>\n                </div>\n                <div id="tab-lineups" class="live-scores-tab-content" style="display:none;"></div>\n                <div id="tab-statistics" class="live-scores-tab-content" style="display:none;"></div>\n                <div id="tab-standings" class="live-scores-tab-content" style="display:none;"></div>\n                <div id="tab-history" class="live-scores-tab-content" style="display:none;">\n                    <div class="history-buttons">\n                        <button id="performance-button">Performans</button>\n                        <button id="h2h-button" class="active">H2H</button>\n                        <button id="team-streaks-button">Takım Serileri</button>\n                        <button id="h2h-streaks-button">H2H Serileri</button>\n                    </div>\n                    <div id="history-content"></div>\n                </div>\n            </div>`},setupMatchDetailsUI:function(n){t.$("#attack-momentum-chart").removeAttr("style"),e.setupMatchDetailsUI(n)},resetTabStates:function(){e.resetTabStates()},updateWithServerData:function(e,a){if(!e||!e.success)return;const o=e.data;void 0!==o.aggregatedWinnerCode&&(t.$("#match-details .qualified-icon").remove(),1===o.aggregatedWinnerCode?t.$("#match-details .live-scores-team.home .live-scores-team-name").append('<i class="fas fa-arrow-up qualified-icon" title="Tur Atlayan Takım"></i>'):2===o.aggregatedWinnerCode&&t.$("#match-details .live-scores-team.away .live-scores-team-name").append('<i class="fas fa-arrow-up qualified-icon" title="Tur Atlayan Takım"></i>'));const s=`matchDetail_previousScore_${a}`;let r=null;try{n&&"function"==typeof n.getFromCacheByType&&n.CACHE_PREFIX&&(r=n.getFromCacheByType(s,n.CACHE_PREFIX.MATCH_DETAIL))}catch(e){}const c=r&&r.score&&"null"!==r.score&&"null - null"!==r.score&&"-"!==r.score&&""!==r.score.trim(),l=o.previousScore&&"null"!==o.previousScore&&"null - null"!==o.previousScore&&"-"!==o.previousScore&&""!==o.previousScore.trim();if(c)d(r.score);else if(l&&null!==o.previousLegEventId){d(o.previousScore);try{if(n&&"function"==typeof n.setToCacheByType&&n.CACHE_PREFIX){const e=window.LiveScoreApp.Constants.getCacheTTL("MATCH_INCIDENTS","live");n.setToCacheByType(s,{score:o.previousScore,eventId:o.previousLegEventId},e,n.CACHE_PREFIX.MATCH_DETAIL)}}catch(e){}}else t.$("#match-details .previous-leg-score").remove();function d(e){const n=t.$("#match-details .live-scores-match-time");n.next(".previous-leg-score").length?n.next(".previous-leg-score").text(`İMS: ${e}`):n.after(`<div class="previous-leg-score">İMS: ${e}</div>`)}const p=window.LiveScoreApp.LiveMatches?window.LiveScoreApp.LiveMatches.get(String(a)):null,u=p&&p.homeScore?p.homeScore.penalties:null,m=p&&p.awayScore?p.awayScore.penalties:null,h=null!==o.homePenaltiesScore&&void 0!==o.homePenaltiesScore&&null!==o.awayPenaltiesScore&&void 0!==o.awayPenaltiesScore,w=null!=u&&null!=m,v=h?o.homePenaltiesScore:w?u:null,f=h?o.awayPenaltiesScore:w?m:null,y=Number(o.statusCode||o.matchStatusCode||0),g=String(o.statusDescription||o.matchTime||"").toUpperCase();if(("finished"===o.matchStatus||"afterpenalties"===o.matchStatus||120===y||g.includes("AP")||g.includes("BİTTİ")||g.includes("BITTI"))&&null!=v&&null!=f){const e=t.$("#match-details .md-hero__score-num");if(e.length>=2){const t=e.eq(0).text(),n=e.eq(1).text();e.eq(0).text(v),e.eq(1).text(f),t===String(v)&&n===String(f)||(e.addClass("md-hero__score-num--pulse"),setTimeout(()=>e.removeClass("md-hero__score-num--pulse"),850))}}else if(void 0!==o.homeTeamDisplayScore&&void 0!==o.awayTeamDisplayScore){const e=t.$("#match-details .md-hero__score-num");if(e.length>=2){const t=e.eq(0).text(),n=e.eq(1).text();e.eq(0).text(o.homeTeamDisplayScore),e.eq(1).text(o.awayTeamDisplayScore),t===String(o.homeTeamDisplayScore)&&n===String(o.awayTeamDisplayScore)||(e.addClass("md-hero__score-num--pulse"),setTimeout(()=>e.removeClass("md-hero__score-num--pulse"),850))}}else if(void 0!==o.homeTeamScore&&void 0!==o.awayTeamScore){const e=t.$("#match-details .md-hero__score-num");if(e.length>=2){const t=e.eq(0).text(),n=e.eq(1).text();e.eq(0).text(o.homeTeamScore),e.eq(1).text(o.awayTeamScore),t===String(o.homeTeamScore)&&n===String(o.awayTeamScore)||(e.addClass("md-hero__score-num--pulse"),setTimeout(()=>e.removeClass("md-hero__score-num--pulse"),850))}}if(o.matchTime){const e=t.$("#match-details .live-scores-match-time"),n=(e.html()||"").trim();let s=o.matchTime;o.matchTime.includes('<span class="match-status')||(i?s=i.formatMinute(o.matchTime,"finished"===o.matchStatus?"finished":"notstarted"===o.matchStatus?"notstarted":"2nd half",a,o):o.matchTime.match(/Bitti|Başlamadı|Ertelendi|Gecikme/)||(s=o.matchTime.replace("'","")+'<span class="blinking-quote">\'</span>')),n!==s.trim()&&e.html(s),e.attr("data-match-id",a)}const S=`matchDetail_aggregateScore_${a}`;let A=null;try{n&&"function"==typeof n.getFromCacheByType&&n.CACHE_PREFIX&&(A=n.getFromCacheByType(S,n.CACHE_PREFIX.MATCH_DETAIL))}catch(e){}const L=A&&null!==A.homeScore&&void 0!==A.homeScore&&null!==A.awayScore&&void 0!==A.awayScore,b=null!==o.homeAggregatedScore&&void 0!==o.homeAggregatedScore&&null!==o.awayAggregatedScore&&void 0!==o.awayAggregatedScore;if(L)C(A.homeScore,A.awayScore);else if(b){C(o.homeAggregatedScore,o.awayAggregatedScore);try{if(n&&"function"==typeof n.setToCacheByType&&n.CACHE_PREFIX){const e=window.LiveScoreApp.Constants.getCacheTTL("MATCH_INCIDENTS","live");n.setToCacheByType(S,{homeScore:o.homeAggregatedScore,awayScore:o.awayAggregatedScore},e,n.CACHE_PREFIX.MATCH_DETAIL)}}catch(e){}}else t.$("#match-details .md-hero__extra .aggregate-ims").remove();function C(e,n){const i=`<span class="aggregate-ims" title="Toplam Skor (İki Aşamalı)"><strong>Top:</strong> ${e}-${n}</span>`,a=t.$("#match-details .md-hero__extra");if(a.length){const e=a.find(".aggregate-ims");e.length?e.replaceWith(i):a.prepend(i)}else t.$("#match-details .md-hero__center .md-hero__score").after(`<div class="md-hero__extra">${i}</div>`)}const x=`matchDetail_penaltyScore_${a}`;let T=null;try{n&&"function"==typeof n.getFromCacheByType&&n.CACHE_PREFIX&&(T=n.getFromCacheByType(x,n.CACHE_PREFIX.MATCH_DETAIL))}catch(e){}const k=T&&null!==T.homeScore&&void 0!==T.homeScore&&null!==T.awayScore&&void 0!==T.awayScore,M=null!==o.homePenaltiesScore&&void 0!==o.homePenaltiesScore&&null!==o.awayPenaltiesScore&&void 0!==o.awayPenaltiesScore;if(k)$(T.homeScore,T.awayScore);else if(M){$(o.homePenaltiesScore,o.awayPenaltiesScore);try{if(n&&"function"==typeof n.setToCacheByType&&n.CACHE_PREFIX){const e=window.LiveScoreApp.Constants.getCacheTTL("MATCH_INCIDENTS","live");n.setToCacheByType(x,{homeScore:o.homePenaltiesScore,awayScore:o.awayPenaltiesScore},e,n.CACHE_PREFIX.MATCH_DETAIL)}}catch(e){}}else t.$("#match-details .md-hero__extra .aggregate-penalty").remove();function $(e,n){const i=`<span class="aggregate-penalty" title="Penaltı Atışı"><strong>Pen:</strong> ${e}-${n}</span>`,a=t.$("#match-details .md-hero__extra");if(a.length){const e=a.find(".aggregate-penalty");e.length?e.replaceWith(i):a.append(i)}else t.$("#match-details .md-hero__center .md-hero__score").after(`<div class="md-hero__extra">${i}</div>`)}}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.Skeleton=function(){function e(e=5){let t="";for(let n=0;n<e;n++)t+='\n            <div class="live-scores-match skeleton-match">\n                <div class="live-scores-time-container">\n                    <div class="live-scores-time skeleton-pulse"></div>\n                    <div class="live-scores-minute skeleton-pulse"></div>\n                </div>\n                <div class="live-scores-teams">\n                    <div class="live-scores-team">\n                        <div class="team-logo skeleton-pulse"></div>\n                        <div class="live-scores-name skeleton-pulse"></div>\n                        <div class="live-scores-score skeleton-pulse"></div>\n                    </div>\n                    <div class="live-scores-team">\n                        <div class="team-logo skeleton-pulse"></div>\n                        <div class="live-scores-name skeleton-pulse"></div>\n                        <div class="live-scores-score skeleton-pulse"></div>\n                    </div>\n                </div>\n            </div>';return t}function t(t=2){let n="";for(let i=0;i<t;i++)n+=`\n            <div class="live-scores-tournament">\n                <div class="live-scores-tournament-card">\n                    <div class="live-scores-tournament-flag skeleton-pulse"></div>\n                    <h2 class="live-scores-tournament-title skeleton-pulse"></h2>\n                </div>\n                ${e(Math.floor(3*Math.random())+2)}\n            </div>`;return n}function n(){let e='\n        <div class="statistics-period-selection" style="background-color: #f5f5f5; border-radius: 10px; padding: 6px;">\n            <div class="skeleton-pulse" style="width: 80px; height: 30px; border-radius: 8px; margin: 0 5px; flex: 1;"></div>\n            <div class="skeleton-pulse" style="width: 80px; height: 30px; border-radius: 8px; margin: 0 5px; flex: 1;"></div>\n            <div class="skeleton-pulse" style="width: 80px; height: 30px; border-radius: 8px; margin: 0 5px; flex: 1;"></div>\n        </div>';e+='\n        <div style="margin: 20px 0 25px 0;">\n            <div class="skeleton-pulse" style="width: 70%; height: 20px; border-radius: 8px; margin: 0 auto 16px auto; border-left: 3px solid #f0f0f0;"></div>\n        ';for(let t=0;t<3;t++)e+='\n            <div class="live-scores-stat-row" style="margin-bottom: 24px;">\n                <div class="skeleton-pulse" style="width: 50%; height: 16px; margin: 0 auto 10px auto;"></div>\n                <div class="live-scores-stat-bar-container" style="height: 10px; background-color: #f0f0f0; border-radius: 10px; overflow: hidden;">\n                    <div class="skeleton-pulse" style="width: 100%; height: 10px;"></div>\n                </div>\n                <div style="display: flex; justify-content: space-between; margin-top: 5px;">\n                    <div class="skeleton-pulse" style="width: 30px; height: 18px; border-radius: 4px;"></div>\n                    <div class="skeleton-pulse" style="width: 30px; height: 18px; border-radius: 4px;"></div>\n                </div>\n            </div>';e+='\n            <div class="skeleton-pulse" style="width: 60%; height: 20px; border-radius: 8px; margin: 30px auto 20px auto; border-left: 3px solid #f0f0f0;"></div>\n        ';for(let t=0;t<2;t++)e+='\n            <div class="live-scores-stat-row" style="margin-bottom: 24px;">\n                <div class="skeleton-pulse" style="width: 45%; height: 16px; margin: 0 auto 10px auto;"></div>\n                <div style="display: flex; justify-content: space-between; align-items: center; margin-top: 10px;">\n                    <div style="display: flex; flex-direction: column; align-items: center; width: 48%;">\n                        <div class="skeleton-pulse-slow" style="width: 60px; height: 60px; border-radius: 50%;"></div>\n                        <div class="skeleton-pulse" style="width: 40px; height: 14px; margin-top: 8px;"></div>\n                    </div>\n                    <div style="display: flex; flex-direction: column; align-items: center; width: 48%;">\n                        <div class="skeleton-pulse-slow" style="width: 60px; height: 60px; border-radius: 50%;"></div>\n                        <div class="skeleton-pulse" style="width: 40px; height: 14px; margin-top: 8px;"></div>\n                    </div>\n                </div>\n            </div>';return e+="</div>",e}function i(){let e='\n        <div class="history-buttons">\n            <div class="skeleton-pulse" style="width: 80px; height: 30px; border-radius: 5px; margin: 0 5px;"></div>\n            <div class="skeleton-pulse" style="width: 80px; height: 30px; border-radius: 5px; margin: 0 5px;"></div>\n            <div class="skeleton-pulse" style="width: 80px; height: 30px; border-radius: 5px; margin: 0 5px;"></div>\n        </div>\n        <div class="h2h-content">';for(let t=0;t<5;t++)e+='\n            <div class="h2h-match-card match-card">\n                <div class="h2h-time-container time-container">\n                    <div class="h2h-time time skeleton-pulse" style="width: 60px; height: 14px;"></div>\n                </div>\n                <div class="h2h-teams teams">\n                    <div class="h2h-team team">\n                        <div class="h2h-team-logo team-logo skeleton-pulse"></div>\n                        <div class="h2h-team-name team-name skeleton-pulse" style="width: 120px; height: 14px;"></div>\n                    </div>\n                    <div class="h2h-score-card score-card skeleton-pulse"></div>\n                    <div class="h2h-team team">\n                        <div class="h2h-team-logo team-logo skeleton-pulse"></div>\n                        <div class="h2h-team-name team-name skeleton-pulse" style="width: 120px; height: 14px;"></div>\n                    </div>\n                </div>\n            </div>';return e+="</div>",e}function a(){let e='<div class="performance-container">';for(let t=0;t<2;t++){e+='<div class="performance-team">';for(let t=0;t<4;t++)e+='\n                <div class="performance-card">\n                    <div class="match-date">\n                        <div class="skeleton-pulse" style="width: 80px; height: 12px;"></div>\n                        <div class="tournament-name skeleton-pulse" style="width: 120px; height: 12px;"></div>\n                    </div>\n                    <div class="match-teams">\n                        <div class="team-score-row">\n                            <div class="team">\n                                <div class="team-logo skeleton-pulse"></div>\n                                <div class="team-name skeleton-pulse" style="width: 100px; height: 14px;"></div>\n                            </div>\n                            <div class="match-score skeleton-pulse" style="width: 20px; height: 18px;"></div>\n                        </div>\n                        <div class="team-score-row">\n                            <div class="team">\n                                <div class="team-logo skeleton-pulse"></div>\n                                <div class="team-name skeleton-pulse" style="width: 100px; height: 14px;"></div>\n                            </div>\n                            <div class="match-score skeleton-pulse" style="width: 20px; height: 18px;"></div>\n                        </div>\n                    </div>\n                </div>';e+="</div>"}return e+="</div>",e}function o(){let e='\n        <div class="standings-period-selection">\n            <div class="skeleton-pulse" style="width: 80px; height: 30px; border-radius: 5px; margin: 0 5px; display: inline-block;"></div>\n            <div class="skeleton-pulse" style="width: 80px; height: 30px; border-radius: 5px; margin: 0 5px; display: inline-block;"></div>\n        </div>\n        <table class="standings-table">\n            <thead>\n                <tr>\n                    <th class="position-cell skeleton-pulse"></th>\n                    <th class="team-cell skeleton-pulse"></th>\n                    <th class="matches-cell skeleton-pulse"></th>\n                    <th class="wins-cell skeleton-pulse"></th>\n                    <th class="draws-cell skeleton-pulse"></th>\n                    <th class="losses-cell skeleton-pulse"></th>\n                    <th class="goals-cell skeleton-pulse"></th>\n                    <th class="points-cell skeleton-pulse"></th>\n                </tr>\n            </thead>\n            <tbody>';for(let t=0;t<8;t++)e+='\n                <tr>\n                    <td class="position-cell skeleton-pulse"></td>\n                    <td class="team-cell skeleton-pulse"></td>\n                    <td class="matches-cell skeleton-pulse"></td>\n                    <td class="wins-cell skeleton-pulse"></td>\n                    <td class="draws-cell skeleton-pulse"></td>\n                    <td class="losses-cell skeleton-pulse"></td>\n                    <td class="goals-cell skeleton-pulse"></td>\n                    <td class="points-cell skeleton-pulse"></td>\n                </tr>';return e+="\n            </tbody>\n        </table>",e}function s(){let e="";for(let t=0;t<6;t++)e+=`\n            <div class="incident ${t%2==0?"home-incident":"away-incident"}">\n                <div class="incident-time skeleton-pulse" style="width: 30px; height: 14px;"></div>\n                <div class="incident-details">\n                    <div class="skeleton-pulse" style="width: 16px; height: 16px; border-radius: 50%; margin-right: 5px;"></div>\n                    <div class="incident-player skeleton-pulse" style="width: 100px; height: 14px;"></div>\n                </div>\n            </div>`;return e}return document.addEventListener("DOMContentLoaded",function(){const e=document.createElement("div");e.className="skeleton-pulse",e.style.position="absolute",e.style.left="-9999px",e.style.width="20px",e.style.height="20px",document.body.appendChild(e);const t=window.getComputedStyle(e);if(t.animation||t.webkitAnimation);else if(!document.getElementById("skeleton-inline-styles")){const e=document.createElement("style");e.id="skeleton-inline-styles",e.textContent='\n            /* Temel skeleton çerçevesi */\n            .skeleton-match,\n            .skeleton-tournament,\n            .skeleton-pulse,\n            .skeleton-pulse-slow {\n                background-color: #e9ecef;\n                border-radius: 4px;\n                position: relative;\n                overflow: hidden;\n            }\n\n            /* Pulse Animation - Hızlı */\n            .skeleton-pulse::after {\n                content: "";\n                display: block;\n                position: absolute;\n                top: 0;\n                left: 0;\n                right: 0;\n                bottom: 0;\n                background: linear-gradient(90deg, \n                            rgba(255, 255, 255, 0) 0%, \n                            rgba(255, 255, 255, 0.4) 50%, \n                            rgba(255, 255, 255, 0) 100%);\n                animation: pulse 1.5s ease-in-out infinite;\n            }\n\n            /* Pulse Animation - Yavaş */\n            .skeleton-pulse-slow::after {\n                content: "";\n                display: block;\n                position: absolute;\n                top: 0;\n                left: 0;\n                right: 0;\n                bottom: 0;\n                background: linear-gradient(90deg, \n                            rgba(255, 255, 255, 0) 0%, \n                            rgba(255, 255, 255, 0.4) 50%, \n                            rgba(255, 255, 255, 0) 100%);\n                animation: pulse 2.5s ease-in-out infinite;\n            }\n\n            @keyframes pulse {\n                0% {\n                    transform: translateX(-100%);\n                }\n                100% {\n                    transform: translateX(100%);\n                }\n            }\n            ',document.head.appendChild(e)}document.body.removeChild(e)}),{getMatchCardSkeleton:e,getTournamentSkeleton:t,getMatchDetailsSkeleton:function(){return'\n        <div class="md-hero">\n            <div class="md-hero__topbar">\n                <div class="skeleton-pulse" style="width: 24px; height: 24px; border-radius: 50%;"></div>\n                <div class="skeleton-pulse" style="width: 120px; height: 14px; border-radius: 8px;"></div>\n                <div class="skeleton-pulse" style="width: 24px; height: 24px; border-radius: 50%;"></div>\n            </div>\n            <div class="md-hero__scoreboard">\n                <div class="md-hero__team">\n                    <div class="md-hero__logo skeleton-pulse"></div>\n                    <div class="skeleton-pulse" style="width: 70px; height: 13px; border-radius: 6px; margin-top: 6px;"></div>\n                </div>\n                <div class="md-hero__center">\n                    <div class="skeleton-pulse" style="width: 90px; height: 40px; border-radius: 10px;"></div>\n                    <div class="skeleton-pulse" style="width: 60px; height: 14px; border-radius: 8px; margin-top: 6px;"></div>\n                </div>\n                <div class="md-hero__team">\n                    <div class="md-hero__logo skeleton-pulse"></div>\n                    <div class="skeleton-pulse" style="width: 70px; height: 13px; border-radius: 6px; margin-top: 6px;"></div>\n                </div>\n            </div>\n        </div>\n        <div class="live-scores-menu">\n            <div class="live-scores-menu-item skeleton-pulse"></div>\n            <div class="live-scores-menu-item skeleton-pulse"></div>\n            <div class="live-scores-menu-item skeleton-pulse"></div>\n            <div class="live-scores-menu-item skeleton-pulse"></div>\n        </div>\n        <div class="live-scores-tab-content live-scores-active">\n            <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 10px;"></div>\n            <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 10px;"></div>\n            <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 10px;"></div>\n            <div class="skeleton-pulse" style="width: 90%; height: 20px;"></div>\n        </div>'},getStatisticsSkeleton:n,getLineupSkeleton:function(){return'\n        <div class="team-info-card home-team-info-card">\n            <div class="team-info">\n                <div class="team-name skeleton-pulse" style="width: 50%; height: 16px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="team-coach skeleton-pulse" style="width: 70%; height: 14px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="team-formation skeleton-pulse" style="width: 30%; height: 14px; background-color: rgba(220,255,220,0.4);"></div>\n            </div>\n        </div>\n        <div class="lineup-field-image-container" style="width: 100%; height: auto; position: relative;">\n            <img src="/images/mac/soccer-field.png" class="lineup-field-image" style="width: 100%; height: auto;" alt="Saha Görseli" width="360" height="540">\n            \n            \x3c!-- Ev sahibi takımı pozisyon yerleşimleri (Yumuşak renkte) --\x3e\n            <div class="skeleton-players home-players">\n                \x3c!-- Kaleci pozisyonu --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 50%; top: 7%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                \n                \x3c!-- Defans pozisyonları - Örnek 4-4-2 için --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 10%; top: 17%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 17%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 17%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 90%; top: 17%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                \n                \x3c!-- Orta saha pozisyonları --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 10%; top: 30%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 30%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 30%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 90%; top: 30%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                \n                \x3c!-- Forvet pozisyonları --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 45%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 45%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n            </div>\n            \n            \x3c!-- Deplasman takımı pozisyon yerleşimleri (Yumuşak renkte) --\x3e\n            <div class="skeleton-players away-players">\n                \x3c!-- Kaleci pozisyonu --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 50%; top: 94%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                \n                \x3c!-- Defans pozisyonları - Örnek 4-4-2 için --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 10%; top: 83%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 83%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 83%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 90%; top: 83%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                \n                \x3c!-- Orta saha pozisyonları --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 10%; top: 70%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 70%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 70%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 90%; top: 70%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                \n                \x3c!-- Forvet pozisyonları --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 55%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 55%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n            </div>\n        </div>\n        <div class="team-info-card away-team-info-card">\n            <div class="team-info">\n                <div class="team-name skeleton-pulse" style="width: 50%; height: 16px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="team-coach skeleton-pulse" style="width: 70%; height: 14px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="team-formation skeleton-pulse" style="width: 30%; height: 14px; background-color: rgba(220,255,220,0.4);"></div>\n            </div>\n        </div>\n        \n        \x3c!-- Yedek oyuncular bölümü iskelet yapısı --\x3e\n        <div class="substitutes-wrapper" style="margin-top: 20px; display: flex; justify-content: space-between;">\n            <div style="width: 48%;">\n                <div class="skeleton-pulse" style="width: 100%; height: 30px; margin-bottom: 10px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 5px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 5px; background-color: rgba(220,255,220,0.4);"></div>\n            </div>\n            <div style="width: 48%;">\n                <div class="skeleton-pulse" style="width: 100%; height: 30px; margin-bottom: 10px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 5px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 5px; background-color: rgba(220,255,220,0.4);"></div>\n            </div>\n        </div>'},getH2HSkeleton:i,getPerformanceSkeleton:a,getStandingsSkeleton:o,getIncidentsSkeleton:s,getSkeleton:function(r,c={}){switch(r){case"matchCard":default:return e(c.count||5);case"tournament":return t(c.count||2);case"matchDetails":return'\n        <div class="md-hero">\n            <div class="md-hero__topbar">\n                <div class="skeleton-pulse" style="width: 24px; height: 24px; border-radius: 50%;"></div>\n                <div class="skeleton-pulse" style="width: 120px; height: 14px; border-radius: 8px;"></div>\n                <div class="skeleton-pulse" style="width: 24px; height: 24px; border-radius: 50%;"></div>\n            </div>\n            <div class="md-hero__scoreboard">\n                <div class="md-hero__team">\n                    <div class="md-hero__logo skeleton-pulse"></div>\n                    <div class="skeleton-pulse" style="width: 70px; height: 13px; border-radius: 6px; margin-top: 6px;"></div>\n                </div>\n                <div class="md-hero__center">\n                    <div class="skeleton-pulse" style="width: 90px; height: 40px; border-radius: 10px;"></div>\n                    <div class="skeleton-pulse" style="width: 60px; height: 14px; border-radius: 8px; margin-top: 6px;"></div>\n                </div>\n                <div class="md-hero__team">\n                    <div class="md-hero__logo skeleton-pulse"></div>\n                    <div class="skeleton-pulse" style="width: 70px; height: 13px; border-radius: 6px; margin-top: 6px;"></div>\n                </div>\n            </div>\n        </div>\n        <div class="live-scores-menu">\n            <div class="live-scores-menu-item skeleton-pulse"></div>\n            <div class="live-scores-menu-item skeleton-pulse"></div>\n            <div class="live-scores-menu-item skeleton-pulse"></div>\n            <div class="live-scores-menu-item skeleton-pulse"></div>\n        </div>\n        <div class="live-scores-tab-content live-scores-active">\n            <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 10px;"></div>\n            <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 10px;"></div>\n            <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 10px;"></div>\n            <div class="skeleton-pulse" style="width: 90%; height: 20px;"></div>\n        </div>';case"statistics":return n();case"lineup":return'\n        <div class="team-info-card home-team-info-card">\n            <div class="team-info">\n                <div class="team-name skeleton-pulse" style="width: 50%; height: 16px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="team-coach skeleton-pulse" style="width: 70%; height: 14px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="team-formation skeleton-pulse" style="width: 30%; height: 14px; background-color: rgba(220,255,220,0.4);"></div>\n            </div>\n        </div>\n        <div class="lineup-field-image-container" style="width: 100%; height: auto; position: relative;">\n            <img src="/images/mac/soccer-field.png" class="lineup-field-image" style="width: 100%; height: auto;" alt="Saha Görseli" width="360" height="540">\n            \n            \x3c!-- Ev sahibi takımı pozisyon yerleşimleri (Yumuşak renkte) --\x3e\n            <div class="skeleton-players home-players">\n                \x3c!-- Kaleci pozisyonu --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 50%; top: 7%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                \n                \x3c!-- Defans pozisyonları - Örnek 4-4-2 için --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 10%; top: 17%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 17%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 17%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 90%; top: 17%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                \n                \x3c!-- Orta saha pozisyonları --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 10%; top: 30%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 30%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 30%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 90%; top: 30%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                \n                \x3c!-- Forvet pozisyonları --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 45%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 45%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(220,240,255,0.3); border: 1px solid rgba(200,220,255,0.5);"></div>\n                </div>\n            </div>\n            \n            \x3c!-- Deplasman takımı pozisyon yerleşimleri (Yumuşak renkte) --\x3e\n            <div class="skeleton-players away-players">\n                \x3c!-- Kaleci pozisyonu --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 50%; top: 94%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                \n                \x3c!-- Defans pozisyonları - Örnek 4-4-2 için --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 10%; top: 83%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 83%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 83%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 90%; top: 83%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                \n                \x3c!-- Orta saha pozisyonları --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 10%; top: 70%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 70%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 70%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 90%; top: 70%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                \n                \x3c!-- Forvet pozisyonları --\x3e\n                <div class="skeleton-player" style="position: absolute; left: 35%; top: 55%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n                <div class="skeleton-player" style="position: absolute; left: 65%; top: 55%; transform: translate(-50%, -50%);">\n                    <div class="skeleton-player-circle" style="width: 22px; height: 22px; border-radius: 50%; background-color: rgba(255,240,240,0.3); border: 1px solid rgba(255,220,220,0.5);"></div>\n                </div>\n            </div>\n        </div>\n        <div class="team-info-card away-team-info-card">\n            <div class="team-info">\n                <div class="team-name skeleton-pulse" style="width: 50%; height: 16px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="team-coach skeleton-pulse" style="width: 70%; height: 14px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="team-formation skeleton-pulse" style="width: 30%; height: 14px; background-color: rgba(220,255,220,0.4);"></div>\n            </div>\n        </div>\n        \n        \x3c!-- Yedek oyuncular bölümü iskelet yapısı --\x3e\n        <div class="substitutes-wrapper" style="margin-top: 20px; display: flex; justify-content: space-between;">\n            <div style="width: 48%;">\n                <div class="skeleton-pulse" style="width: 100%; height: 30px; margin-bottom: 10px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 5px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 5px; background-color: rgba(220,255,220,0.4);"></div>\n            </div>\n            <div style="width: 48%;">\n                <div class="skeleton-pulse" style="width: 100%; height: 30px; margin-bottom: 10px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 5px; background-color: rgba(220,255,220,0.4);"></div>\n                <div class="skeleton-pulse" style="width: 100%; height: 20px; margin-bottom: 5px; background-color: rgba(220,255,220,0.4);"></div>\n            </div>\n        </div>';case"h2h":return i();case"performance":return a();case"standings":return o();case"incidents":return s()}}}}(),document.addEventListener("DOMContentLoaded",function(){if(document.querySelector("#skeleton-inline-styles"))return;const e=document.createElement("div");e.className="skeleton-pulse",e.style.position="absolute",e.style.left="-9999px",e.style.width="20px",e.style.height="20px",document.body.appendChild(e);const t=window.getComputedStyle(e),n=t.animation||t.webkitAnimation;if(document.body.removeChild(e),n)return;const i=document.createElement("style");i.id="skeleton-inline-styles",i.innerHTML='\n        /* Temel skeleton çerçevesi */\n        .skeleton-match,\n        .skeleton-tournament,\n        .skeleton-pulse,\n        .skeleton-pulse-slow {\n            background-color: #e9ecef;\n            border-radius: 4px;\n            position: relative;\n            overflow: hidden;\n        }\n\n        /* Pulse Animation - Hızlı */\n        .skeleton-pulse::after {\n            content: "";\n            display: block;\n            position: absolute;\n            top: 0;\n            left: 0;\n            right: 0;\n            bottom: 0;\n            background: linear-gradient(90deg, \n                        rgba(255, 255, 255, 0) 0%, \n                        rgba(255, 255, 255, 0.4) 50%, \n                        rgba(255, 255, 255, 0) 100%);\n            animation: pulse 1.5s ease-in-out infinite;\n        }\n\n        /* Pulse Animation - Yavaş */\n        .skeleton-pulse-slow::after {\n            content: "";\n            display: block;\n            position: absolute;\n            top: 0;\n            left: 0;\n            right: 0;\n            bottom: 0;\n            background: linear-gradient(90deg, \n                        rgba(255, 255, 255, 0) 0%, \n                        rgba(255, 255, 255, 0.4) 50%, \n                        rgba(255, 255, 255, 0) 100%);\n            animation: pulse 2.5s ease-in-out infinite;\n        }\n\n        @keyframes pulse {\n            0% {\n                transform: translateX(-100%);\n            }\n            100% {\n                transform: translateX(100%);\n            }\n        }\n\n        /* Skeleton boyutları */\n        .skeleton-match .live-scores-time {\n            width: 45px;\n            height: 14px;\n            margin: 4px auto;\n        }\n\n        .skeleton-match .live-scores-minute {\n            width: 30px;\n            height: 12px;\n            margin: 0 auto;\n        }\n\n        .skeleton-match .team-logo {\n            width: 20px;\n            height: 20px;\n            border-radius: 50%;\n        }\n\n        .skeleton-match .live-scores-name {\n            width: 100px;\n            height: 14px;\n            margin: 4px 0;\n        }\n\n        .skeleton-match .live-scores-score {\n            width: 20px;\n            height: 18px;\n            margin-left: auto;\n        }\n\n        /* Turnuva skeleton özellikleri */\n        .skeleton-match .live-scores-tournament-flag {\n            width: 24px;\n            height: 24px;\n            border-radius: 50%;\n        }\n\n        .skeleton-match .live-scores-tournament-title {\n            width: 200px;\n            height: 18px;\n            margin-left: 10px;\n        }\n\n        /* Maç detayları skeleton özellikleri */\n        .match-details-team-logo.skeleton-pulse {\n            width: 75px;\n            height: 75px;\n            border-radius: 50%;\n            margin: 0 auto 10px auto;\n        }\n\n        .match-details-team-name.skeleton-pulse {\n            width: 100px;\n            height: 16px;\n            margin: 5px auto;\n        }\n\n        .live-scores-team-score.skeleton-pulse {\n            width: 30px;\n            height: 30px;\n            margin: 10px auto;\n        }\n\n        .live-scores-match-time.skeleton-pulse {\n            width: 60px;\n            height: 18px;\n            margin: 5px auto;\n        }\n\n        .previous-leg-score.skeleton-pulse {\n            width: 80px;\n            height: 14px;\n            margin: 5px auto;\n        }\n\n        /* Sekmeler için skeleton */\n        .live-scores-menu-item.skeleton-pulse {\n            width: 70px;\n            height: 20px;\n            display: inline-block;\n            margin: 0 10px;\n        }\n\n        /* Mobil uyumlu boyutlar */\n        @media (max-width: 768px){\n            .match-details-team-logo.skeleton-pulse {\n                width: 50px;\n                height: 50px;\n            }\n            \n            .skeleton-match .live-scores-name {\n                width: 80px;\n            }\n        }',document.head.appendChild(i)}),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.AttackMomentum=function(){const e=window.LiveScoreApp.Utils.Cache,t=(window.LiveScoreApp.Config,window.LiveScoreApp.Utils.RequestQueue,window.LiveScoreApp.Utils.jQuery),n=(window.LiveScoreApp.Utils.Compression,new Map);let i=null,a=null;function o(e){return n.has(e)||n.set(e,{chart:null,data:null,interval:null,retryTimeout:null,fastRetryCount:0,pollNow:null}),n.get(e)}function s(e,t="background"){const n=e>=0;return"background"===t?n?"rgba(0, 180, 0, 0.3)":"rgba(0, 0, 200, 0.3)":"border"===t?n?"rgba(0, 180, 0, 1)":"rgba(0, 0, 200, 1)":"rgba(0, 0, 0, 0.5)"}function r(e){if(!e||!Array.isArray(e))return{labels:[],data:[],backgroundColors:[],borderColors:[]};const t=[],n=[],i=[],a=[];for(let o=1;o<=90;o++){t.push(o);const r=e.find(e=>e.minute==o),c=r?r.value:0;n.push(c),i.push(s(c,"background")),a.push(s(c,"border"))}return e.filter(e=>e.minute>90).forEach(e=>{t.push(e.minute),n.push(e.value),i.push(s(e.value,"background")),a.push(s(e.value,"border"))}),{labels:t,data:n,backgroundColors:i,borderColors:a}}function c(e){const t={},n={},i={},a={};return Array.isArray(e)?(e.forEach((e,o)=>{if(!e.time&&0!==e.time)return;if(e.time<0)return;const s=e.time,r=!0===e.isHome,c="cancelled"===e.status||!0===e.isCancelled;"goal"===e.incidentType&&(c?(n[s]||(n[s]={home:0,away:0}),r?n[s].home++:n[s].away++):(t[s]||(t[s]={home:0,away:0}),r?t[s].home++:t[s].away++)),"card"===e.incidentType&&"red"===e.incidentClass&&(i[s]||(i[s]={home:0,away:0}),r?i[s].home++:i[s].away++),"card"===e.incidentType&&"yellowRed"===e.incidentClass&&(a[s]||(a[s]={home:0,away:0}),r?a[s].home++:a[s].away++)}),{goalsByMinute:t,cancelledGoalsByMinute:n,cardsByMinute:i,yellowRedsByMinute:a}):{goalsByMinute:t,cancelledGoalsByMinute:n,cardsByMinute:i,yellowRedsByMinute:a}}function l(e,t,n){let i="";if(t.goals>0){const e=parseInt(t.goals,10)||0;i+=`<span class="incident-icon goal-icon" data-count="${e}" title="Gol (${e}x)">⚽</span>`}if(t.cancelledGoals>0){const e=parseInt(t.cancelledGoals,10)||0;i+=`<span class="incident-icon cancelled-goal-icon" data-count="${e}" title="İptal edilen gol (${e}x)">❌</span>`}if(t.reds>0){const e=parseInt(t.reds,10)||0;i+=`<span class="incident-icon red-card-icon" data-count="${e}" title="Kırmızı Kart (${e}x)"></span>`}if(t.yellowReds>0){const e=parseInt(t.yellowReds,10)||0;i+=`<span class="incident-icon yellow-red-card-icon" data-count="${e}" title="2. Sarı=Kırmızı (${e}x)"></span>`}return i?`<div class="incident-icons ${n}">${i}</div>`:""}function d(e,n,i,a,o,s,r){const c=t.$("#attack-momentum-graph-canvas");if(!c.length)return;if(!(r&&r.chartArea&&r.scales&&r.scales.x))return;t.$(".incident-icons-container").remove();const d=r.chartArea,p=r.scales.x,u=r.canvas,m=u.offsetLeft,h=u.offsetTop+d.top,w=d.bottom-d.top;let v=0;const f=new Set;Object.keys(e).forEach(e=>f.add(parseInt(e,10))),Object.keys(n).forEach(e=>f.add(parseInt(e,10))),Object.keys(i).forEach(e=>f.add(parseInt(e,10))),Object.keys(a).forEach(e=>f.add(parseInt(e,10)));const y=Array.from(f).sort((e,t)=>e-t).map(t=>{const s=e[t],r=n[t],c=i[t],u=a[t];let h="",w="";s&&(h+=l(0,{goals:s.home,cancelledGoals:0,reds:0,yellowReds:0},"top"),w+=l(0,{goals:s.away,cancelledGoals:0,reds:0,yellowReds:0},"bottom"),v+=s.home+s.away),r&&(h+=l(0,{goals:0,cancelledGoals:r.home,reds:0,yellowReds:0},"top"),w+=l(0,{goals:0,cancelledGoals:r.away,reds:0,yellowReds:0},"bottom"),v+=r.home+r.away),c&&(h+=l(0,{goals:0,cancelledGoals:0,reds:c.home,yellowReds:0},"top"),w+=l(0,{goals:0,cancelledGoals:0,reds:c.away,yellowReds:0},"bottom"),v+=c.home+c.away),u&&(h+=l(0,{goals:0,cancelledGoals:0,reds:0,yellowReds:u.home},"top"),w+=l(0,{goals:0,cancelledGoals:0,reds:0,yellowReds:u.away},"bottom"),v+=u.home+u.away);const f=o.indexOf(t);let y;if(-1!==f)y=m+p.getPixelForValue(f);else{const e=d.right-d.left,n=Math.max(...o)||90;y=m+d.left+t/n*e}return`\n                <div class="minute-incident-overlay" style="left: ${y}px;">\n                    ${h}\n                    ${w}\n                </div>\n            `}).filter(e=>e).join("");if(y){const e=`position:absolute; top:${h}px; left:0; width:100%; height:${w}px; pointer-events:none; z-index:100; overflow:visible;`,n=t.$(`<div class="incident-icons-container" style="${e}">${y}</div>`);c.append(n)}}function p(e,t){const n=e?"finished":"live";return window.LiveScoreApp.Constants.getCacheTTL("ATTACK_MOMENTUM",n)}function u(){const e=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails?window.LiveScoreApp.Modules.MatchDetails:null;if("details"===(e?e.getCurrentTab():null))return!0;const t=document.getElementById("tab-details");if(!t)return!1;const n=t.classList.contains("live-scores-active"),i=null!==t.offsetParent&&"none"!==window.getComputedStyle(t).display;return n&&i}function m(s,r,c,l){if(l=!!l,r)return i=null,void(a=null);i=s,a=c;const d=n.get(s);if(d&&d.interval)return void(l&&"function"==typeof d.pollNow&&d.pollNow());h(s);const m=o(s);function v(){m.retryTimeout||m.fastRetryCount>=3||(m.fastRetryCount++,m.retryTimeout=setTimeout(function(){if(m.retryTimeout=null,"hidden"===document.visibilityState)return;const e=window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null;u()&&e===s&&y()},1e4))}function y(){if("hidden"===document.visibilityState)return;if(!u())return;window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails&&window.LiveScoreApp.Modules.MatchDetails;const n=`${s}_${c}_attack_momentum`,i=e.CACHE_PREFIX.MATCH_DETAIL+n;e.deleteCacheItem&&e.deleteCacheItem(i);const a=document.getElementById("momentumChart")&&window.momentumChart;var o=window.LiveScoresAjax&&window.LiveScoresAjax.ajax_url||"/wp-admin/admin-ajax.php",r=t.$('.live-scores-match[data-match-id="'+s+'"]').data("status")||"inprogress",l=new FormData;l.append("action","get_attack_momentum"),l.append("match_id",s),l.append("match_status",r),l.append("tournament_id",c||""),fetch(o,{method:"POST",body:l}).then(function(e){return e.json()}).then(function(i){var o=i&&i.success?i.data:null;if(o&&o.graphPoints&&o.graphPoints.length){if(o.graphPoints.length>0&&u()){var r=t.$(".attack-momentum-team-logo.home-team-logo img").attr("src"),l=t.$(".attack-momentum-team-logo.away-team-logo img").attr("src"),d=(o.incidents||[]).filter(function(e,t,n){return n.findIndex(function(t){return t.time===e.time&&t.incidentType===e.incidentType})===t}),h={graphPoints:o.graphPoints,homeTeamLogo:r,awayTeamLogo:l,incidents:d,tournamentId:o.tournamentId||c},y=p(!1);y>0&&e.setToCacheByType(n,h,y,e.CACHE_PREFIX.MATCH_DETAIL),m.retryTimeout&&(clearTimeout(m.retryTimeout),m.retryTimeout=null),m.fastRetryCount=0,a?w(o.graphPoints,d,o.tournamentId||c):f(o.graphPoints,r||"",l||"",d,o.tournamentId||c,null,s)}}else v()}).catch(function(e){v()})}m.pollNow=y,m.interval=setInterval(function(){y()},6e4),setTimeout(function(){y()},1500)}function h(e=null){if(e){const t=n.get(e);t&&t.interval&&(clearInterval(t.interval),t.interval=null),t&&t.retryTimeout&&(clearTimeout(t.retryTimeout),t.retryTimeout=null)}else n.forEach(e=>{e.interval&&(clearInterval(e.interval),e.interval=null),e.retryTimeout&&(clearTimeout(e.retryTimeout),e.retryTimeout=null)}),window.attackMomentumUpdateInterval&&(clearInterval(window.attackMomentumUpdateInterval),window.attackMomentumUpdateInterval=null)}function w(e,n,i=null){if(!window.momentumChart||!e||!e.length)return;const a=r(e);a.labels.length>window.momentumChart.data.labels.length&&(window.momentumChart.data.labels=a.labels),window.momentumChart.data.datasets[0].data=a.data,window.momentumChart.data.datasets[0].backgroundColor=a.backgroundColors,window.momentumChart.data.datasets[0].borderColor=a.borderColors,window.momentumChart.update("none");const o=t.$('.live-scores-match[data-match-id="'+window.currentMatchId+'"]').find(".live-scores-team.home").data("team-id");if(n&&n.length>0){const{goalsByMinute:e,cancelledGoalsByMinute:t,cardsByMinute:i,yellowRedsByMinute:s}=c(n);window.momentumChart._incidentData={goalsByMinute:e,cancelledGoalsByMinute:t,cardsByMinute:i,yellowRedsByMinute:s,labels:a.labels,homeTeamId:o},d(e,t,i,s,a.labels,0,window.momentumChart)}}function v(n,i,a){const o=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails?window.LiveScoreApp.Modules.MatchDetails:null,s=t.$('.live-scores-match[data-match-id="'+n+'"]'),r=s.data("tournament-id"),c=`${n}_${r}_attack_momentum`,l=e.getFromCacheByType(c,e.CACHE_PREFIX.MATCH_DETAIL),d=(o&&o.getCurrentTab(),u());if(l){try{t.$("#attack-momentum-chart").show(),f(l.graphPoints,l.homeTeamLogo,l.awayTeamLogo,l.incidents||[],l.tournamentId,null,n),m(n,i,l.tournamentId);const e=l.graphPoints&&Array.isArray(l.graphPoints)&&l.graphPoints.length>0;a(e)}catch(e){a(!1)}return}const h=s.data("status"),w=s.find(".live-scores-team.home .team-logo").attr("src"),v=s.find(".live-scores-team.away .team-logo").attr("src"),y=s.data("status"),g=p("finished"===y||"cancelled"===y);if("notstarted"===h)return t.$("#attack-momentum-chart").html(""),void a(!1);d&&t.$("#attack-momentum-chart").empty().show();const S=window.LiveScoreApp.Utils.RequestIdGenerator,A=S?S.generateId(n,"get_attack_momentum"):null;return("undefined"!=typeof QueuedAjax&&QueuedAjax?QueuedAjax.request("get_attack_momentum",{match_id:n,request_id:A,match_status:h||"",tournament_id:r||""}):t.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:{action:"get_attack_momentum",match_id:n,request_id:A,match_status:h||"",tournament_id:r||"",nonce:window.liveScoresNonce||""}})).then(function(o){if(!function(e){if(!e||"object"!=typeof e)return!1;if(!0!==e.success)return!1;if(!e.data||"object"!=typeof e.data)return!1;e.data.incidents=function(e){if(Array.isArray(e))return e;if(e&&"object"==typeof e){const t=Object.values(e);let n=null;for(let e=0;e<t.length;e++){const i=t[e];if(Array.isArray(i)&&0!==i.length&&i.some(e=>"object"==typeof e&&null!==e&&"incidentType"in e)){n=i;break}}return Array.isArray(n)?n:t.filter(e=>e&&"object"==typeof e&&!Array.isArray(e))}return[]}(e.data.incidents);const t=function(e){if(!Array.isArray(e))return!1;if(0===e.length)return!0;for(let t=0;t<e.length;t++){const n=e[t];if(!n||"object"!=typeof n)return!1;if("number"!=typeof n.minute)return!1;if("number"!=typeof n.value)return!1}return!0}(e.data.graphPoints),n=function(e){if(!Array.isArray(e))return!1;if(0===e.length)return!0;for(let t=0;t<e.length;t++){const n=e[t];if(!n||null===n||"object"!=typeof n||Array.isArray(n))return!1}return!0}(e.data.incidents);return!e.data.tournamentId||function(e){if(null==e)return!1;if("string"!=typeof e&&"number"!=typeof e)return!1;const t=String(e).trim();!/^\d+$/.test(t)||parseInt(t,10)}(e.data.tournamentId),!t&&n?(e.data.graphPoints=[],!0):!!t&&(n||(e.data.incidents=[]),!0)}(o))return t.$("#attack-momentum-chart").html("<p>Hücum verisi yüklenemedi. Lütfen sayfayı yenileyin.</p>"),void a(!1);const s=o&&o.data&&o.data.graphPoints&&o.data.graphPoints.length>0;if(o&&o.data&&o.data.incidents&&o.data.incidents.length,s){const s={graphPoints:o.data.graphPoints,homeTeamLogo:w,awayTeamLogo:v,incidents:o.data.incidents||[],tournamentId:o.data.tournamentId||r};g>0&&e.setToCacheByType(c,s,g,e.CACHE_PREFIX.MATCH_DETAIL),d?(t.$("#attack-momentum-chart").show(),f(s.graphPoints,w,v,s.incidents,s.tournamentId,a,n),i||m(n,i,s.tournamentId)):a(!0)}else o&&o.data&&o.data.message?(t.$("#attack-momentum-chart").html(`<p>${o.data.message}</p>`).show(),a(!1)):(g>0&&e.setToCacheByType(c,{graphPoints:[],homeTeamLogo:w,awayTeamLogo:v},g,e.CACHE_PREFIX.MATCH_DETAIL),d&&t.$("#attack-momentum-chart").hide(),a(!1))}).catch(function(e){a(!1)})}function f(e,n,i,a=[],s,l,p){if(!e||0===e.length)return t.$("#attack-momentum-chart").hide(),void(l&&l(!1));t.$("#attack-momentum-chart").show(),window.momentumChartData={graphPoints:e,homeTeamLogo:n,awayTeamLogo:i,incidents:a,tournamentId:s,matchId:p,callbackFn:l},t.$("#attack-momentum-chart").html(""),window.LiveScoreApp&&window.LiveScoreApp.loadChartJS?window.LiveScoreApp.loadChartJS(function(e){if(e){const e=t.$('.live-scores-match[data-match-id="'+window.currentMatchId+'"]');if(0===e.length)return void(l&&l(!1));const n=e.find(".live-scores-team.home").data("team-id"),i=window.momentumChartData||{},a=i.homeTeamLogo||"",s=i.awayTeamLogo||"",p=i.matchId;!function(e,n,i,a=[],s,l,p){if(!e||0===e.length)return void t.$("#attack-momentum-chart").hide();if(!u())return;const m=t.$("#attack-momentum-chart");if(0===m.length)return;m.show(),m.html(`\n            <div id="attack-momentum-graph-container">\n                <div class="attack-momentum-team-logo home-team-logo">\n                    <img src="${n}" width="30" height="30" alt="Ev sahibi takım logosu">\n                </div>\n                <div id="attack-momentum-graph-canvas">\n                    <canvas id="momentumChart" role="img" aria-label="Maç baskı grafiği — ev sahibi ve deplasman takımı dakika bazlı baskı yoğunluğu"></canvas>\n                </div>\n                <div class="attack-momentum-team-logo away-team-logo">\n                    <img src="${i}" width="30" height="30" alt="Deplasman takım logosu">\n                </div>\n                <div class="attack-momentum-legend">\n                    <div class="legend-item">\n                        <span class="legend-color home-color"></span>\n                        <span class="legend-text">Ev Sahibi Baskısı</span>\n                    </div>\n                    <div class="legend-item">\n                        <span class="legend-color away-color"></span>\n                        <span class="legend-text">Deplasman Baskısı</span>\n                    </div>\n                </div>\n            </div>\n        `);const h=document.getElementById("momentumChart");if(!h)return;const w=h.getContext("2d");if(!w)return;const v=r(e),f={id:"teamLogoPositioner",afterDraw:function(e){const t=document.getElementById("attack-momentum-graph-container");if(!t||!e.chartArea)return;const n=t.querySelector(".home-team-logo"),i=t.querySelector(".away-team-logo");if(!n&&!i)return;const a=e.chartArea,o=document.getElementById("attack-momentum-graph-canvas");if(!o)return;const s=o.offsetTop+a.top,r=a.bottom-a.top;if(n){const e=s+r/4-10;n.style.top=e+"px",n.style.bottom="auto"}if(i){const e=s+3*r/4-10;i.style.top=e+"px",i.style.bottom="auto"}}},y={id:"customBackground",beforeDraw:function(e){const t=e.ctx,n=e.chartArea,i=n.top,a=n.bottom,o=n.left,s=n.right,r=(i+a)/2;if(t.save(),t.fillStyle="rgba(0, 180, 0, 0.15)",t.fillRect(o,i,s-o,r-i),t.fillStyle="rgba(0, 0, 200, 0.15)",t.fillRect(o,r,s-o,a-r),v.labels.length>0){if(v.labels.length>=45){const e=o+(s-o)*(44/(v.labels.length-1));t.strokeStyle="rgba(0, 0, 0, 0.5)",t.lineWidth=2,t.setLineDash([6,6]),t.beginPath(),t.moveTo(e,i),t.lineTo(e,a),t.stroke()}if(v.labels.length>=90){const e=o+(s-o)*(89/(v.labels.length-1));t.strokeStyle="rgba(0, 0, 0, 0.5)",t.lineWidth=2,t.setLineDash([6,6]),t.beginPath(),t.moveTo(e,i),t.lineTo(e,a),t.stroke()}t.strokeStyle="rgba(0, 0, 0, 0.2)",t.lineWidth=1,t.setLineDash([3,3]),[15,30,60,75].forEach(e=>{if(v.labels.length>=e){const n=o+(s-o)*((e-1)/(v.labels.length-1));t.beginPath(),t.moveTo(n,i),t.lineTo(n,a),t.stroke()}})}t.restore()}},g=p?o(p):null;if(g&&g.chart)try{"undefined"!=typeof Chart&&g.chart instanceof Chart&&g.chart.destroy(),g.chart=null}catch(e){g.chart=null}if(window.momentumChart)try{"undefined"!=typeof Chart&&window.momentumChart instanceof Chart&&window.momentumChart.destroy(),window.momentumChart=null}catch(e){window.momentumChart=null}const S=t.$(window).width();let A=5;S<=480?A=15:S<=768&&(A=10);let L=null;if(a&&a.length>0)try{const e=c(a);L={goalsByMinute:e.goalsByMinute,cancelledGoalsByMinute:e.cancelledGoalsByMinute,cardsByMinute:e.cardsByMinute,yellowRedsByMinute:e.yellowRedsByMinute,labels:v.labels,homeTeamId:s}}catch(e){}const b={id:"incidentIconPositioner",afterDraw:function(e){const t=e._incidentData||L;if(!t)return;if(!e.chartArea||!e.scales||!e.scales.x)return;const n=e.chartArea,i=n.left+"|"+n.top+"|"+n.right+"|"+n.bottom;e._lastAreaKey!==i&&(e._lastAreaKey=i,e._incidentData||(e._incidentData=t),d(t.goalsByMinute,t.cancelledGoalsByMinute,t.cardsByMinute,t.yellowRedsByMinute,t.labels,t.homeTeamId,e))}};try{const e=new Chart(w,{type:"bar",data:{labels:v.labels,datasets:[{label:"Baskı Grafiği",data:v.data,backgroundColor:v.backgroundColors,borderColor:v.borderColors,borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{display:!1},ticks:{display:!0,callback:function(e,t){return S<=480?0===e||45===e||90===e?e+"'":"":t%A===0?e:""},font:{size:S<=768?10:12,family:"Arial, sans-serif"}},title:{display:!0,text:"Dakika",font:{size:S<=768?12:14,family:"Arial, sans-serif"}}},y:{beginAtZero:!0,min:-100,max:100,display:!1}},interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!1},tooltip:{enabled:!1},title:{display:!0,text:"Baskı Grafiği",font:{size:S<=768?16:18,weight:"bold",family:"Arial, sans-serif"},padding:{top:10,bottom:15}}}},plugins:[y,f,b]});a&&a.length,g&&(g.chart=e),window.momentumChart=e,l&&"function"==typeof l&&l(!0)}catch(e){return t.$("#attack-momentum-chart").html(""),void(l&&"function"==typeof l&&l(!1))}}(i.graphPoints,a,s,i.incidents,n,l,p)}else l&&l(!1)}):l&&l(!1)}return"undefined"!=typeof window&&(window.addEventListener("beforeunload",h),window.addEventListener("unload",h),document.addEventListener("visibilitychange",function(){if(!document.hidden&&i){const e=n.get(i);e&&"function"==typeof e.pollNow?e.pollNow():m(i,!1,a,!0)}})),{fetchAttackMomentum:v,renderAttackMomentumChart:f,updateAttackMomentumTab:function(e,t,n){return window.console&&window.console.log&&window.console.log("[🔴🔴🔴 DIRECT CONSOLE] updateAttackMomentumTab START",{matchId:e,isFinished:t}),window.currentMatchId=e,new Promise(i=>{const a=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails?window.LiveScoreApp.Modules.MatchDetails:null;if(a&&a.getCurrentTab(),!u())return n&&n(!1),void i(!1);v(e,t,function(e){n&&n(e),i(e)})})},setupAutoUpdate:m,stopAutoUpdate:h,updateChartData:w,cleanupIntervals:h}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.Lineups=function(){const e=window.LiveScoreApp.Utils.Cache,t=(window.LiveScoreApp.Config,window.LiveScoreApp.Utils.RequestQueue,window.LiveScoreApp.Utils.Translator),n=window.LiveScoreApp.Utils.jQuery,i=window.LiveScoreApp.Utils.PlayerModuleLoader,a=window.LiveScoreApp.Components&&window.LiveScoreApp.Components.Skeleton;function o(e,t){return"undefined"!=typeof QueuedAjax&&QueuedAjax?QueuedAjax.request(e,t).then(s):n.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:Object.assign({action:e,nonce:window.liveScoresNonce||""},t)}).then(s)}function s(e){return e&&void 0!==e.success&&e.data?e.data:e}function r(e,t={}){window.LiveScoreApp&&window.LiveScoreApp.debugMode}function c(e,t={}){window.LiveScoreApp&&window.LiveScoreApp.debugMode||e.includes("Error")||e.includes("Failed")}const l=new Map;function d(e){const t=window.LiveScoreApp.currentMatchDetailsData?.[e];return{home:t&&t.homeManagerName||null,away:t&&t.awayManagerName||null}}function p(e){const t=d(e);if(!t.home&&!t.away)return!1;const i=n.$("#tab-lineups");let a=!1;if(t.home){const e=i.find(".home-team-info-card .team-coach");e.length&&-1!==e.text().indexOf("Bilinmiyor")&&(e.text("Teknik Direktör: "+t.home),a=!0)}if(t.away){const e=i.find(".away-team-info-card .team-coach");e.length&&-1!==e.text().indexOf("Bilinmiyor")&&(e.text("Teknik Direktör: "+t.away),a=!0)}return a}function u(){a&&"function"==typeof a.getLineupSkeleton?n.$("#tab-lineups").html(a.getLineupSkeleton()):window.LiveScoreApp.loadSkeletonUI?(n.$("#tab-lineups").html('<div class="loading-spinner"></div>'),window.LiveScoreApp.loadSkeletonUI(function(e){e&&"function"==typeof e.getLineupSkeleton&&n.$("#tab-lineups").html(e.getLineupSkeleton())})):n.$("#tab-lineups").html('<div class="loading-spinner"></div>')}function m(e){return e&&"object"==typeof e?e.lineups&&"object"==typeof e.lineups?e.lineups:e:null}function h(e,t,n,i){let a=v(t,n);if(e.length>a.length&&(c("Oyuncu sayısı ("+e.length+") pozisyon sayısından ("+a.length+") fazla, 4-4-2 formatına geçiliyor"),a=v("4-4-2",n)),e.length>a.length&&(a=function(e,t){const n=[],i=t?7:94,a=t?1:-1;n.push({x:50,y:i});const o=e-1,s=Math.ceil(o/3);let r=1;for(let t=0;t<3&&r<e;t++){const o=i+a*(10+15*t),c=Math.min(s,e-r);for(let e=0;e<c;e++){const t=10+80/(c-1||1)*e;n.push({x:Math.min(90,Math.max(10,t)),y:o}),r++}}return n}(e.length,n)),!a||!a.length)return c("Pozisyon bilgisi oluşturulamadı"),"<p>Kadro görüntülenemiyor. Lütfen daha sonra tekrar deneyin.</p>";const o=n?a:a.map(e=>({...e,x:100-e.x}));return function(e,t,n){if(e&&!(e.length<2)){t=t||8,n=n||10;for(let i=0;i<e.length;i++)for(let a=i+1;a<e.length;a++){const o=Math.abs(e[i].x-e[a].x),s=Math.abs(e[i].y-e[a].y);if(o<t&&s<n)if(s<3){const n=(t-o)/2+1;e[i].x<e[a].x?(e[i].x=Math.max(2,e[i].x-n),e[a].x=Math.min(98,e[a].x+n)):(e[a].x=Math.max(2,e[a].x-n),e[i].x=Math.min(98,e[i].x+n))}else{const t=(n-s)/2+1;e[i].y<e[a].y?(e[i].y=Math.max(2,e[i].y-t),e[a].y=Math.min(98,e[a].y+t)):(e[a].y=Math.max(2,e[a].y-t),e[i].y=Math.min(98,e[i].y+t))}}}}(o),e.map((t,n)=>{const a=o[n],s=t.player&&t.player.id||0,r=`/canli-skor/oyuncu/${s}/${t.player&&t.player.slug||""}`,c=s?"https://cdn.sporkolik.net/players/"+s+".png":"https://cdn.sporkolik.net/players/default_player.png",l=t.jerseyNumber||"N/A";let d;d=t.player&&t.player.shortName&&""!==t.player.shortName.trim()?t.player.shortName:t.player&&t.player.name&&""!==t.player.name.trim()?t.player.name:"N/A";let p="";t.statistics&&t.statistics.rating?p=t.statistics.rating.toFixed(1):t.statistics&&0===t.statistics.rating&&(p="0.0");const u=""!==p?`<div class="player-rating">${p}</div>`:"",m=t.statistics&&void 0!==t.statistics.minutesPlayed&&t.statistics.minutesPlayed>0&&!t.substitute&&function(){const n=function(e){let t=0;return e&&Array.isArray(e)&&e.forEach(e=>{e.statistics&&e.statistics.minutesPlayed&&(t=Math.max(t,e.statistics.minutesPlayed))}),t||90}(e);return t.statistics.minutesPlayed<n}()?'<i class="fa-solid fa-sort-down substitution-icon"></i>':"",h=t.statistics&&t.statistics.minutesPlayed&&t.substitute?'<i class="fa-solid fa-sort-up substitution-icon"></i>':"";return`<div class="player clickable-player" style="left:${a.x}%; top:${a.y}%" data-match-id="${i}" data-player-id="${t.player.id}">\n                        ${u}\n                        <img src="${c}" alt="${d}" class="player-photo" width="36" height="36" onerror="this.onerror=null;this.src='https://cdn.sporkolik.net/players/default_player.png';">\n                        ${m}\n                        ${h}\n                        <span class="player-number">${l}</span>\n                        <a href="${r}" class="player-name">${d}</a>\n                    </div>`}).join("")}function w(e,n,i,a){return e&&0!==e.length?`\n            <div class="substitutes-container-wrapper">\n                <div class="substitutes-container ${i?"home-substitutes":"away-substitutes"}">\n                    <div class="substitutes-header">${t.translateName("teams",n)} Yedekleri</div>\n                    <div class="substitutes-list">\n                        ${e.map(e=>{const t=e.jerseyNumber||"N/A",n=`/canli-skor/oyuncu/${e.player&&e.player.id||0}/${e.player&&e.player.slug||""}`;let i;i=e.player&&e.player.shortName&&""!==e.player.shortName.trim()?e.player.shortName:e.player&&e.player.name&&""!==e.player.name.trim()?e.player.name:"N/A";const o=e.statistics&&e.statistics.minutesPlayed>0,s=o?'<i class="fa-solid fa-sort-up substitution-icon-substitute"></i>':"";return`\n                <div class="substitute-player ${o?"substitute-entered":""}" data-match-id="${a||"unknown"}" data-player-id="${e.player?e.player.id:"unknown"}">\n                    <span class="substitute-number">${t}</span>\n                    <a href="${n}" class="substitute-name">${i}</a>\n                    ${s}\n                </div>\n            `}).join("")}\n                    </div>\n                </div>\n            </div>\n        `:""}function v(e,t){return window.formations?window.formations[e]?t?window.formations[e].home:window.formations[e].away:window.formations["4-4-2"]?(c('Diziliş "'+e+"\" bulunamadı, formations.js'teki 4-4-2 kullanılıyor"),t?window.formations["4-4-2"].home:window.formations["4-4-2"].away):(c("formations.js'te 4-4-2 dizilişi bulunamadı!"),[]):(c("formations.js dosyası yüklenmemiş!"),[])}async function f(t){try{const i=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails?window.LiveScoreApp.Modules.MatchDetails:null;if(!i||"lineups"!==i.getCurrentTab())return!1;if(n.$("#tab-lineups").data("updating"))return!1;n.$("#tab-lineups").data("updating",!0);const a=m(await o("get_match_lineups",{match_id:t,match_status:"inprogress"}));if(!(a&&204!==a.status&&!1!==a.hasData&&a.home&&a.away&&Array.isArray(a.home.players)&&Array.isArray(a.away.players)))return n.$("#tab-lineups").removeData("updating"),!1;let s=!1;const r=a.home.players||[],c=a.away.players||[];if([...r,...c].forEach(e=>{const t=e.jerseyNumber||"N/A",i=e.player&&e.player.shortName&&""!==e.player.shortName.trim()?e.player.shortName:e.player&&e.player.name?e.player.name:"N/A";let a="";e.statistics&&void 0!==e.statistics.rating&&(a=e.statistics.rating.toFixed(1));const o=!0===e.substitute,r=o?n.$(`.substitute-player:contains("${t}"):contains("${i}")`):n.$(`.player:contains("${t}"):contains("${i}")`);r.length>0&&r.each(function(){const e=n.$(this);if(o)return;const t=e.find(".player-rating"),i=t.length?t.text():"";""!==a&&a!==i&&(t.length?(t.text(a),t.addClass("rating-updated"),setTimeout(()=>{t.removeClass("rating-updated")},3e3)):(e.prepend(`<div class="player-rating rating-updated">${a}</div>`),setTimeout(()=>{e.find(".player-rating").removeClass("rating-updated")},3e3)),s=!0)})}),n.$("#tab-lineups").removeData("updating"),s)try{e.CACHE_PREFIX.LINEUP;const n=e.getFromCacheByType(t,e.CACHE_PREFIX.LINEUP);if("string"==typeof n);else if(n&&"object"==typeof n){const n=window.LiveScoreApp.Constants.getCacheTTL("LINEUPS","live");e.setToCacheByType(t,a,n,e.CACHE_PREFIX.LINEUP)}}catch(e){}return s}catch(e){return n.$("#tab-lineups").removeData("updating"),c("Silent rating update error:",{matchId:t,error:e.message||e}),!1}}function y(){window.lineupRatingInterval&&(clearInterval(window.lineupRatingInterval),window.lineupRatingInterval=null)}return n.$(document).on("click",".clickable-player, .substitute-player",function(e){if("A"===e.target.tagName||e.target.closest("a"))return;const t=n.$(this).data("match-id"),a=n.$(this).data("player-id");if(!t||!a||"unknown"===t||"unknown"===a)return void c("Geçersiz oyuncu veya maç ID'si:",{matchId:t,playerId:a});let o="N/A",s="N/A",r="N/A",l="notstarted";const d=n.$("#match-details");if(d.length){const e=d.find(".live-scores-team .live-scores-team-name");e.length>=2&&(o=n.$(e[0]).attr("title")||n.$(e[0]).text().trim()||"N/A",s=n.$(e[1]).attr("title")||n.$(e[1]).text().trim()||"N/A");const i=window.LiveScoreApp.LiveMatches&&window.LiveScoreApp.LiveMatches.get(String(t));if(i&&i.startTimestamp){const e=new Date(1e3*i.startTimestamp);r=e.toLocaleDateString("tr-TR",{day:"2-digit",month:"2-digit",year:"numeric"})}else{const e=n.$("#date-picker").val();e&&(r=e)}}if("N/A"===o){const e=n.$('.live-scores-match[data-match-id="'+t+'"]');if(e.length){const t=e.find(".live-scores-team.home .live-scores-name").text().trim(),n=e.find(".live-scores-team.away .live-scores-name").text().trim();t&&(o=t),n&&(s=n)}}const p=n.$('.live-scores-match[data-match-id="'+t+'"]');if(p.length&&(l=p.data("status")||"notstarted"),t&&a){const e=n.$(this).find(".player-rating"),d=e.length?e.text().trim():"";window.LiveScoreApp.Components.PlayerPopup&&"function"==typeof window.LiveScoreApp.Components.PlayerPopup.openPlayerPopup?window.LiveScoreApp.Components.PlayerPopup.openPlayerPopup(t,a,o,s,r,l,d):i&&"function"==typeof i.loadAsync?i.loadAsync().then(function(e){window.LiveScoreApp.Components.PlayerPopup&&"function"==typeof window.LiveScoreApp.Components.PlayerPopup.openPlayerPopup?window.LiveScoreApp.Components.PlayerPopup.openPlayerPopup(t,a,o,s,r,l,d):c("PlayerPopup modülü yüklendikten sonra tanımsız kaldı.")}).catch(function(e){c("PlayerPopup/PlayerCharts yükleme hatası:",e)}):c("PlayerModuleLoader kullanılabilir değil.")}}),{fetchLineups:function(e,a,s){if(!e)return void("function"==typeof s&&s(!1,null));i&&"function"==typeof i.loadAsync&&!i.isReady()&&i.loadAsync().then(function(){}).catch(function(e){});const r=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails?window.LiveScoreApp.Modules.MatchDetails:null,l=r?r.getCurrentTab():null;if(!r||"lineups"!==l)return void("function"==typeof s&&s(!1,null));n.$('.live-scores-match[data-match-id="'+e+'"]').data("status");const v=window.LiveScoreApp._prefetchedLineups?.[e],f=v&&Date.now()-v.timestamp<12e4;f&&delete window.LiveScoreApp._prefetchedLineups[e],f||u();const y=function(e){try{const t=n.$('.live-scores-match[data-match-id="'+e+'"]');if(0===t.length)return null;const i=t.find(".live-scores-team.home .live-scores-name").text().trim(),a=t.find(".live-scores-team.away .live-scores-name").text().trim();return i&&a?{homeTeamName:i,awayTeamName:a,homeTeamRaw:i,awayTeamRaw:a,homeCoach:t.attr("data-home-coach")||"",awayCoach:t.attr("data-away-coach")||""}:null}catch(e){return null}}(e);if(!y)return n.$("#tab-lineups").html("<p>Kadrolar bilgisi mevcut değil.</p>"),void("function"==typeof s&&s(!1,null));let g=t.translateName("teams",y.homeTeamRaw||"Bilinmiyor"),S=t.translateName("teams",y.awayTeamRaw||"Bilinmiyor");const A=d(e);let L=A.home||"Bilinmiyor",b=A.away||"Bilinmiyor";function C(t){if(!(t=m(t))||204===t.status||!1===t.hasData||null===t.data)return n.$("#tab-lineups").html("<p>Bu maç için kadro bilgisi henüz mevcut değil.</p>"),void("function"==typeof s&&s(!1,null));if(!(t.home&&t.away&&Array.isArray(t.home.players)&&Array.isArray(t.away.players)&&0!==t.home.players.length&&0!==t.away.players.length))return n.$("#tab-lineups").html("<p>Kadro bilgileri henüz tamamlanmamış.</p>"),void("function"==typeof s&&s(!1,null));if(t.home.manager&&t.home.manager.name&&(L=t.home.manager.name),t.away.manager&&t.away.manager.name&&(b=t.away.manager.name),"Bilinmiyor"===L||"Bilinmiyor"===b){const t=d(e);"Bilinmiyor"===L&&t.home&&(L=t.home),"Bilinmiyor"===b&&t.away&&(b=t.away)}let i=t.home.formation,a=t.away.formation;i&&""!==i.trim()||(i="4-4-2"),a&&""!==a.trim()||(a="4-4-2");const o=t.home.players.filter(e=>!e.substitute),r=t.away.players.filter(e=>!e.substitute),c=t.home.players.filter(e=>e.substitute),u=t.away.players.filter(e=>e.substitute),v=`\n                                    <div class="team-info-card home-team-info-card">\n                                        <div class="team-info">\n                                            <span class="team-name">${g}</span>\n                                            <span class="team-coach">Teknik Direktör: ${L}</span>\n                                            <span class="team-formation">Diziliş: ${i}</span>\n                                        </div>\n                                    </div>\n                                    <div class="lineup-field-image-container" style="width: 100%; height: auto;">\n                                        <img src="/images/mac/soccer-field.png" class="lineup-field-image" width="360" height="540" style="width: 100%; height: auto;" alt="Saha Görseli">\n                                        <div class="home-team-players">${h(o,i,!0,e)}</div>\n                                        <div class="away-team-players">${h(r,a,!1,e)}</div>\n                                    </div>\n                                    <div class="team-info-card away-team-info-card">\n                                        <div class="team-info">\n                                            <span class="team-name">${S}</span>\n                                            <span class="team-coach">Teknik Direktör: ${b}</span>\n                                            <span class="team-formation">Diziliş: ${a}</span>\n                                        </div>\n                                    </div><div class="substitutes-wrapper">\n                                        ${w(c,g,!0,e)}\n                                        ${w(u,S,!1,e)}\n                                    </div>`;if("lineups"===l&&(n.$("#tab-lineups").html(v),p(e)),"function"==typeof s&&s(!0,v),"Bilinmiyor"===L||"Bilinmiyor"===b){let t=0;const n=15,i=setInterval(function(){t++,(p(e)||t>=n)&&clearInterval(i)},500)}var f;(f=t)&&(f.home&&f.home.players&&Array.isArray(f.home.players)&&f.home.players.forEach(e=>{if(e.statistics){const t=e.statistics.minutesPlayed,n=e.statistics.rating;e.statistics={minutesPlayed:t,rating:n}}if(e.player){const t=e.player.name,n=e.player.shortName;e.player={name:t,shortName:n}}}),f.away&&f.away.players&&Array.isArray(f.away.players)&&f.away.players.forEach(e=>{if(e.statistics){const t=e.statistics.minutesPlayed,n=e.statistics.rating;e.statistics={minutesPlayed:t,rating:n}}if(e.player){const t=e.player.name,n=e.player.shortName;e.player={name:t,shortName:n}}}))}f?C(v.response):o("get_match_lineups",{match_id:e,match_status:a?"finished":"live"}).then(function(e){C(e)}).catch(function(t){c("Lineups fetch error (will retry):",{matchId:e,error:t}),n.$("#tab-lineups").html('<div class="loading-spinner"></div>'),setTimeout(function(){o("get_match_lineups",{match_id:e,match_status:a?"finished":"live"}).then(function(e){C(e)}).catch(function(t){c("Lineups fetch retry also failed:",{matchId:e,error:t}),n.$("#tab-lineups").html("<p>Kadro bilgileri alınırken bir hata oluştu.</p>"),"function"==typeof s&&s(!1,null)})},3e3)})},generatePlayerHTML:h,generateSubstituteHTML:w,updateLineupsTab:function(t){if(window.LiveScoreApp.Modules.MatchDetails&&"lineups"===window.LiveScoreApp.Modules.MatchDetails.getCurrentTab())if(n.$("#tab-lineups").children().not(".loading-spinner, .skeleton-pulse, .skeleton-pulse-slow").length||u(),window.LiveScoreApp.Components)try{const a=window.LiveScoreApp.Components.Lineups;if(a&&"function"==typeof a.fetchLineups){const o=e.getFromCacheByType(t,e.CACHE_PREFIX.LINEUP);if(o){const e=(i=o)?"string"==typeof i?i:i.html?i.html:i.data&&"string"==typeof i.data?i.data:null:null;if(e)return n.$("#tab-lineups").html(e),void p(t)}!function(e,t){t.fetchLineups(e,!1)}(t,a)}else n.$("#tab-lineups").html("<p>Kadro bilgisi alınamadı. Modül yüklenemedi.</p>")}catch(e){n.$("#tab-lineups").html("<p>Kadro bilgisi alınamadı. Lütfen daha sonra tekrar deneyin.</p>")}else n.$("#tab-lineups").html("<p>Komponenet modülleri yüklenemedi</p>");var i},checkAndFetchLineups:function(t){const i=window.LiveScoreApp.Constants.getCacheTTL("LINEUPS","live"),a=`lineup_check_${t}`,s=e.getFromCacheByType(a,e.CACHE_PREFIX.LINEUP);if(s&&Date.now()-(s.timestamp||0)<i)return void n.$(".lineups-tab").show();const l="lineups-checking-"+t;window.LiveScoreApp.activeRequests&&window.LiveScoreApp.activeRequests[l]||(window.LiveScoreApp.activeRequests||(window.LiveScoreApp.activeRequests={}),window.LiveScoreApp.activeRequests[l]=!0,o("get_match_lineups",{match_id:t,match_status:""}).then(function(i){i=m(i),delete window.LiveScoreApp.activeRequests[l];try{if(!i||204===i.status||!1===i.hasData)return n.$(".lineups-tab").hide(),void r();if(!(i.home&&i.away&&Array.isArray(i.home.players)&&Array.isArray(i.away.players)&&0!==i.home.players.length&&0!==i.away.players.length))return n.$(".lineups-tab").hide(),void r();n.$(".lineups-tab").show();const s={exists:!0,timestamp:Date.now(),home_count:i.home.players.length,away_count:i.away.players.length},c=window.LiveScoreApp.Constants.getCacheTTL("LINEUPS","live");e.setToCacheByType(a,s,c,e.CACHE_PREFIX.LINEUP),window.LiveScoreApp._prefetchedLineups=window.LiveScoreApp._prefetchedLineups||{},window.LiveScoreApp._prefetchedLineups[t]={response:i,timestamp:Date.now()};var o={};i.home.players.forEach(function(e){e.player&&e.player.id&&(o[e.player.id]=!0)}),i.away.players.forEach(function(e){e.player&&e.player.id&&(o[e.player.id]=!1)}),window.LiveScoreApp._playerTeamMap=window.LiveScoreApp._playerTeamMap||{},window.LiveScoreApp._playerTeamMap[t]=o,r(0,{home:i.home.players.length,away:i.away.players.length})}catch(e){c("Lineups check error:",e),n.$(".lineups-tab").hide()}}).catch(function(e){delete window.LiveScoreApp.activeRequests[l],c("Lineups check request failed:",{matchId:t,error:e}),setTimeout(function(){window.LiveScoreApp.activeRequests&&window.LiveScoreApp.activeRequests[l]||(window.LiveScoreApp.activeRequests||(window.LiveScoreApp.activeRequests={}),window.LiveScoreApp.activeRequests[l]=!0,o("get_match_lineups",{match_id:t,match_status:""}).then(function(e){delete window.LiveScoreApp.activeRequests[l],(e=m(e))&&204!==e.status&&!1!==e.hasData&&e.home&&e.away&&Array.isArray(e.home.players)&&Array.isArray(e.away.players)&&0!==e.home.players.length&&0!==e.away.players.length?(n.$(".lineups-tab").show(),r()):(n.$(".lineups-tab").hide(),r())}).catch(function(e){delete window.LiveScoreApp.activeRequests[l],n.$(".lineups-tab").hide(),c("Lineups check retry also failed:",{matchId:t,error:e})}))},3e3)}))},applyManagerNamesFromStore:p,silentRatingUpdate:f,startRatingAutoUpdate:function(e){y(),"finished"!==n.$('.live-scores-match[data-match-id="'+e+'"]').data("status")&&(f(e).then(e=>{}),window.lineupRatingInterval=setInterval(()=>{if("hidden"===document.visibilityState)return;const t=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails;t&&"lineups"===t.getCurrentTab()&&f(e).then(e=>{})},29e3))},stopRatingAutoUpdate:y,cleanupResources:function(){y(),l.forEach((e,t)=>{if(e&&"string"==typeof e&&e.startsWith("blob:"))try{URL.revokeObjectURL(e)}catch(e){}}),l.clear()}}}(),function(){"use strict";var e=null,t=null,n=null;function i(){e||((e=document.createElement("div")).className="bps-overlay",e.setAttribute("aria-hidden","true"),(t=document.createElement("div")).className="bps-sheet",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label","Seri Maçları"),document.body.appendChild(e),document.body.appendChild(t),e.addEventListener("click",o))}function a(i){n=i;var a=i.getAttribute("data-popup-home")||"",c=i.getAttribute("data-popup-away")||"",l=i.getAttribute("data-popup-home-logo")||"",d=i.getAttribute("data-popup-away-logo")||"",p=i.getAttribute("data-popup-leg1-url")||"",u=i.getAttribute("data-popup-leg2-url")||"",m=i.getAttribute("data-popup-leg1-score")||"",h=i.getAttribute("data-popup-leg2-score")||"",w=l?'<img src="'+l+'" class="bps-logo" width="22" height="22" alt="'+r(a)+'" loading="lazy">':'<span class="bps-logo-ph"></span>',v=d?'<img src="'+d+'" class="bps-logo" width="22" height="22" alt="'+r(c)+'" loading="lazy">':'<span class="bps-logo-ph"></span>';function f(e){var t=e?'<span class="bps-leg-score">'+s(e)+"</span>":'<span class="bps-leg-score bps-leg-score-na">-:-</span>';return w+t+v}var y=p?'<a href="'+p+'" class="bps-leg-row bps-leg-link"><span class="bps-leg-num">1. Maç</span><span class="bps-leg-match">'+f(m)+'</span><span class="bps-leg-arrow">&#8250;</span></a>':'<div class="bps-leg-row bps-leg-disabled"><span class="bps-leg-num">1. Maç</span><span class="bps-leg-match">'+f(m)+"</span></div>",g=u?'<a href="'+u+'" class="bps-leg-row bps-leg-link"><span class="bps-leg-num">2. Maç</span><span class="bps-leg-match">'+f(h)+'</span><span class="bps-leg-arrow">&#8250;</span></a>':'<div class="bps-leg-row bps-leg-disabled"><span class="bps-leg-num">2. Maç</span><span class="bps-leg-match">'+f(h)+"</span></div>";t.innerHTML='<div class="bps-header"><div class="bps-matchup">'+w+'<span class="bps-team-name">'+s(a)+'</span><span class="bps-vs">-</span><span class="bps-team-name">'+s(c)+"</span>"+v+'</div><button class="bps-close" aria-label="Kapat">&#x2715;</button></div><p class="bps-subtitle">Bu eşleşme iki maçtan oluşmaktadır</p><div class="bps-legs">'+y+g+"</div>",t.querySelector(".bps-close").addEventListener("click",o),e.classList.add("bps-active"),t.classList.add("bps-active"),document.body.classList.add("bps-open");var S=t.querySelector(".bps-close");S&&setTimeout(function(){S.focus()},50)}function o(){e.classList.remove("bps-active"),t.classList.remove("bps-active"),document.body.classList.remove("bps-open"),n&&"function"==typeof n.focus&&n.focus(),n=null}function s(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function r(e){return String(e).replace(/"/g,"&quot;")}function c(){document.addEventListener("click",function(e){var t=e.target.closest("[data-popup-leg1-url]");t&&(e.preventDefault(),i(),a(t))}),document.addEventListener("keydown",function(e){if("Escape"!==e.key){if("Enter"===e.key||" "===e.key){var n=e.target.closest("[data-popup-leg1-url]");n&&(e.preventDefault(),i(),a(n))}}else t&&t.classList.contains("bps-active")&&o()})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c):c()}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Modules=window.LiveScoreApp.Modules||{},window.LiveScoreApp.DetailClosingFlags=window.LiveScoreApp.DetailClosingFlags||{flags:{},set:function(e,t,n){t?this.flags[e]={isClosing:!0,timestamp:Date.now(),setBy:n||"unknown"}:delete this.flags[e]},isClosing:function(e){return!!this.flags[e]&&(Date.now()-this.flags[e].timestamp>500?(delete this.flags[e],!1):this.flags[e].isClosing)},clear:function(e,t){delete this.flags[e]},clearAll:function(){this.flags={}},clearAll:function(){this.userFlags={},window.LiveScoreApp.debugMode},getState:function(e=null){if(e){const t=this._getUserFlags(e);return{userId:e,flags:Object.assign({},t),keyCount:Object.keys(t).length}}const t=Object.values(this.userFlags).reduce((e,t)=>e+Object.keys(t).length,0);return{users:Object.keys(this.userFlags).length,totalFlags:t,userDetails:Object.assign({},this.userFlags)}}},window.LiveScoreApp.ScriptManager=window.LiveScoreApp.ScriptManager||{loadedScripts:new Set,activeScripts:new Map,tabOpenCount:0,CLEANUP_THRESHOLD:50,loadScript:function(e,t,n={}){return this.loadedScripts.has(e)?Promise.resolve():new Promise((i,a)=>{const o=document.createElement("script");o.src=e,o.async=!0,o.setAttribute("data-module",t),o.setAttribute("data-managed","true"),o.onload=()=>{this.loadedScripts.add(e),this.activeScripts.set(t,{path:e,loadedAt:Date.now(),scriptId:o.getAttribute("data-managed"),isLoaded:!0}),n.onLoad&&"function"==typeof n.onLoad&&n.onLoad(),n.removeAfterLoad&&setTimeout(()=>{try{o.remove()}catch(e){}},100),i()},o.onerror=()=>{const t=new Error(`Script yükleme hatası: ${e}`);n.onError&&"function"==typeof n.onError&&n.onError(t),a(t)},document.head.appendChild(o)})},cleanupOldScripts:function(e){if(!e){const t=window.LiveScoreApp.Config,n=t&&t.optimizationSettings._dynamicInfo;e=n&&n.basedOnLiveMatches>200?6e4:3e5}const t=Date.now();let n=0;for(const[i,a]of this.activeScripts)if(window.LiveScoreApp.Modules[i]&&t-a.loadedAt>e)try{document.querySelectorAll(`script[data-module="${i}"][data-managed="true"]`).forEach(e=>e.remove()),this.activeScripts.delete(i),n++,window.LiveScoreApp.debugMode}catch(e){}return n},emergencyCleanup:function(){const e={totalActive:this.activeScripts.size,totalLoaded:this.loadedScripts.size,totalInDOM:document.querySelectorAll('script[data-managed="true"]').length},t=this.cleanupAllScripts(),n=document.querySelectorAll('script[data-managed="fallback"], script[data-managed="legacy"]');let i=0;n.forEach(e=>{try{e.remove(),i++}catch(e){}});const a={totalActive:this.activeScripts.size,totalLoaded:this.loadedScripts.size,totalInDOM:document.querySelectorAll('script[data-managed="true"]').length};return{scriptsRemoved:t+i,fallbackScriptsRemoved:i,beforeStats:e,afterStats:a,memoryFreed:!0}},checkMemoryHealth:function(){const e=document.querySelectorAll('script[data-managed="true"]').length,t=this.countOrphanedScripts();return{isHealthy:0===t&&e<10,totalManagedScripts:e,activeScripts:this.activeScripts.size,orphanedScripts:t,loadedScripts:this.loadedScripts.size,memoryLeakRisk:t>5?"high":t>2?"medium":"low",recommendedAction:t>3?"emergency_cleanup":t>0?"cleanup_suggested":"healthy"}},cleanupAllScripts:function(){let e=0;return document.querySelectorAll('script[data-managed="true"]').forEach(t=>{try{t.remove(),e++}catch(e){}}),this.activeScripts.clear(),this.loadedScripts.clear(),e},getStatus:function(){const e={};for(const[t,n]of this.activeScripts)e[t]={path:n.path,loadedAt:n.loadedAt,scriptId:n.scriptId,isLoaded:n.isLoaded,age:Date.now()-n.loadedAt,moduleExists:!!window.LiveScoreApp.Modules[t]};return{loadedScripts:Array.from(this.loadedScripts),activeScripts:e,totalLoaded:this.loadedScripts.size,totalActive:this.activeScripts.size,memoryOptimized:!0,orphanedScriptsInDOM:this.countOrphanedScripts(),totalManagedScriptsInDOM:document.querySelectorAll('script[data-managed="true"]').length}},countOrphanedScripts:function(){const e=document.querySelectorAll('script[data-managed="true"]');let t=0;return e.forEach(e=>{const n=e.getAttribute("data-module");n&&!this.activeScripts.has(n)&&t++}),t}},window.LiveScoreApp.ModuleLoadStatus=window.LiveScoreApp.ModuleLoadStatus||{pendingActions:[],addPendingAction:function(e){this.pendingActions.push(e),this.processActionsIfReady()},processActionsIfReady:function(){if(this.areAllModulesReady())for(;this.pendingActions.length>0;){const e=this.pendingActions.shift();try{e()}catch(e){}}},areAllModulesReady:function(){return window.LiveScoreApp.Modules.MatchDetailsUI&&window.LiveScoreApp.Modules.MatchDetailsEvents&&window.LiveScoreApp.Modules.MatchDetailsData&&window.LiveScoreApp.Modules.MatchDetailsTabs}},window.LiveScoreApp.Modules.MatchDetails=function(){let e=null,t=!1;window.LiveScoreApp.Modules.ScoreUpdater;const n=window.LiveScoreApp.Utils.jQuery,i=window.LiveScoreApp.Utils.DomUtils,a=window.LiveScoreApp.Components&&window.LiveScoreApp.Components.Skeleton,o=window.LiveScoreApp.Utils.MinuteCalculator;function s(e,t){return window.QueuedAjax&&"function"==typeof window.QueuedAjax.request?window.QueuedAjax.request(e,t).then(r):new Promise(function(n,i){jQuery.ajax({url:LiveScoresAjax.ajax_url,method:"POST",data:Object.assign({action:e,nonce:LiveScoresAjax.nonce},t),success:function(e){n(r(e))},error:function(e,t,n){i(new Error(n||t||"AJAX error"))}})})}function r(e){return e&&"object"==typeof e&&e.hasOwnProperty("success")&&void 0!==e.data?e.data:e}function c(){try{const e=n.$("#match-details");e.length&&!e.attr("data-initialized")&&(e.addClass("detail-closed"),e.hide(),e.attr("data-initialized","true"),window.LiveScoreApp.debugMode)}catch(e){}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c):c();let l=!1,d=null,p=null,u=null;function m(e){if(!l){d=window.location.pathname+window.location.search;var t=document.querySelector('.live-scores-match[data-match-id="'+e+'"]'),n=t?t.querySelector(".match-card__link"):null,i=n?n.getAttribute("href"):"";history.pushState({matchDetailOpen:!0,matchId:e},"",i||""),l=!0,i&&"function"==typeof gtag&&gtag("event","page_view",{page_location:window.location.origin+i,page_path:i,page_title:document.title})}}function h(){l=!1}function w(e){const t=n.$('.live-scores-match[data-match-id="'+e+'"]'),i=n.$("#match-details"),a=window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null,s=window.LiveScoreApp&&window.LiveScoreApp.detailClosing;if(!t.length||!i.is(":visible")||e!==a||s)return;const r=window.LiveScoreApp.Utils.Cache,c=(window.LiveScoreApp.Config,window.LiveScoreApp.Modules.MatchDetailsData,window.LiveScoreApp.LiveMatches?window.LiveScoreApp.LiveMatches.get(e.toString()):null),l=c&&(null!=c.homeAggregatedScore&&null!=c.awayAggregatedScore||null!=c.homePenaltiesScore&&null!=c.awayPenaltiesScore||null!=c.previousLegEventId);try{if(l&&r&&"function"==typeof r.getFromCacheByType&&r.CACHE_PREFIX){const t=`matchAggregateScore_${e}`,n=r.getFromCacheByType(t,r.CACHE_PREFIX.MATCH_DETAIL);if(n&&void 0!==n.homeScore&&void 0!==n.awayScore){const e=`Top: (${n.homeScore} - ${n.awayScore})`;i.find(".total-score").length?i.find(".total-score").text(e):i.append(`<div class="total-score">${e}</div>`)}const a=`matchPreviousScore_${e}`,o=r.getFromCacheByType(a,r.CACHE_PREFIX.MATCH_DETAIL);if(o&&o.score&&"null"!==o.score&&"null - null"!==o.score&&"-"!==o.score&&"N/A"!==o.score){const e=i.find(".live-scores-match-time");e.next(".previous-leg-score").length?e.next(".previous-leg-score").text(`İMS: ${o.score}`):e.after(`<div class="previous-leg-score">İMS: ${o.score}</div>`)}const s=`matchPenaltyScore_${e}`,c=r.getFromCacheByType(s,r.CACHE_PREFIX.MATCH_DETAIL);if(c&&void 0!==c.homeScore&&void 0!==c.awayScore){const e=`Pen: ${c.homeScore}-${c.awayScore}`;i.find(".penalties-score").length?i.find(".penalties-score").text(e):i.find(".live-scores-match-time-container").append(`<div class="penalties-score">${e}</div>`)}}}catch(e){}try{let n=window.LiveScoreApp.LiveMatches.get(e.toString()),a="",s="",r=String(t.data("status")||"").toLowerCase(),c="finished"===r||"afterpenalties"===r;if(n&&n.homeScore&&n.awayScore){const e=String(n.status&&n.status.type||n.matchStatus||r||"").toLowerCase(),t=Number(n.status&&n.status.code||n.statusCode||n.matchStatusCode||0),i=String(n.status&&n.status.description||n.statusDescription||"").toUpperCase();null!=n.homeScore.penalties&&null!=n.awayScore.penalties&&("finished"===e||"afterpenalties"===e||120===t||i.includes("AP")||i.includes("BİTTİ")||i.includes("BITTI"))?(a=n.homeScore.penalties,s=n.awayScore.penalties):null!=n.homeScore.display&&null!=n.awayScore.display?(a=n.homeScore.display,s=n.awayScore.display):(a=n.homeScore.current,s=n.awayScore.current),e&&(r=e),c="finished"===r||"afterpenalties"===r||120===t||i.includes("AP")||i.includes("BİTTİ")||i.includes("BITTI")}else a=t.find(".live-scores-team.home .live-scores-score").text().trim(),s=t.find(".live-scores-team.away .live-scores-score").text().trim();const l=i.find(".md-hero__score-num");l.length>=2&&(l.eq(0).text()!==String(a)&&l.eq(0).text(a),l.eq(1).text()!==String(s)&&l.eq(1).text(s));const p=i.find(".live-scores-team-score").eq(0),u=i.find(".live-scores-team-score").eq(1);p.length&&p.text()!==String(a)&&p.text(a),u.length&&u.text()!==String(s)&&u.text(s);const m=i.find(".live-scores-match-time");if(c)"Bitti"!==m.text()&&m.text("Bitti");else if(o){const e=(m.html()||"").trim(),n=o.getFormattedMinute(t).trim();e!==n&&m.html(n)}else{const e=t.find(".live-scores-minute, .minute").text(),n=e.match(/Bitti|Başlamadı|Ertelendi|Gecikme/)?"":'<span class="blinking-quote">\'</span>',i=e.replace("'","")+n;m.html()!==i&&m.html(i)}const h=t.data("home-red-cards"),w=t.data("away-red-cards");void 0!==h&&d(".home",h),void 0!==w&&d(".away",w)}catch(e){}function d(e,t){try{const n=i.find(`.live-scores-team${e} .live-scores-team-name`);let a=n.text();a=a.replace(/\s*<i class="fas fa-square red-card-icon"><\/i>\s*x\d*|\s*<i class="fas fa-square red-card-icon"><\/i>/g,""),a=a.replace(/\s*⚫\sx\d*|\s*⚫/g,"");let o="";t>0&&(o=1===t?' <i class="fas fa-square red-card-icon"></i>':' <i class="fas fa-square red-card-icon"></i> x'+t),n.html(a+o)}catch(e){}}}function v(e){f();const t=window.LiveScoreApp.Constants.getCacheTTL("LIVE_SCORES","live")||6e3,i=Math.max(t-1e3,5e3);window.detailHeaderUpdateInterval=window.setInterval(function(){const t=n.$("#match-details");t&&t.is(":visible")?w(e):f()},i),window.LiveScoreApp.debugMode}function f(){window.detailHeaderUpdateInterval&&(window.clearInterval(window.detailHeaderUpdateInterval),window.detailHeaderUpdateInterval=null,window.LiveScoreApp.debugMode)}return window.addEventListener("popstate",function(e){l&&h()}),{updateMatchDetails:function(o){if(t)return;t=!0,p&&(clearTimeout(p),p=null),u&&(clearTimeout(u),u=null),window.LiveScoreApp.detailClosing=!1,window.LiveScoreApp._detailGeneration=(window.LiveScoreApp._detailGeneration||0)+1;const r=n.$('.live-scores-match[data-match-id="'+o+'"]');if(r.length){try{window.LiveScoreApp.Utils.MinuteCalculator&&"function"==typeof window.LiveScoreApp.Utils.MinuteCalculator.stopAutoUpdate&&window.LiveScoreApp.Utils.MinuteCalculator.stopAutoUpdate()}catch(e){}e=null,window.LiveScoreApp.hasStandingsData=void 0,window.LiveScoreApp.Components?.Standings?.stopPolling&&window.LiveScoreApp.Components.Standings.stopPolling(),n.$("#attack-momentum-chart").css("display",""),"notstarted"!==r.data("status")&&(n.$(".statistics-tab").show(),n.$('.live-scores-menu-item[data-tab="details"]').show(),r.data("tournament-id")&&r.data("season-id")&&n.$(".standings-tab").show());try{const e=r.data("tournament-id"),t=r.data("season-id"),i=r.data("group-id")||0;if(e&&t){const a=window.LiveScoreApp.Utils.Cache,o=`standings_check_${e}_${t}_${i}`,c=a.getFromCacheByType(o,a.CACHE_PREFIX.STANDING);c&&!0===c.exists&&(n.$(".standings-tab").show(),window.LiveScoreApp.hasStandingsData=!0);const l=async function(){const c="total";try{const l=await s("get_standings_data",{tournament_id:e,season_id:t,type:c});if(l&&l.standings&&l.standings.length>0){let s;if(s=i?l.standings.find(e=>e.tournament.id==i):l.standings[0],s&&s.rows&&s.rows.length>0){window.LiveScoreApp.Config;const l=`standings_${e}_${t}_${c}${i?"_"+i:""}`,d="finished"===r.data("status")?"finished":"live",p="finished"===d?1/0:window.LiveScoreApp.Constants.getCacheTTL("STANDINGS",d);a.setToCacheByType(l,s,p,a.CACHE_PREFIX.STANDING);const u={exists:!0,timestamp:Date.now()};return a.setToCacheByType(o,u,p,a.CACHE_PREFIX.STANDING),n.$(".standings-tab").show(),!0}}}catch(e){}return!1};c&&!0===c.exists||setTimeout(function(){l().catch(e=>{})},1e3)}else n.$(".standings-tab").hide(),window.LiveScoreApp.hasStandingsData=!1}catch(e){}try{const e=r.data("status");if("notstarted"===e);else{const t="finished"===e,i=async function(){try{const e=await s("get_match_statistics",{match_id:o,period:"ALL",match_status:t?"finished":"live"});if(e&&e.statistics&&e.statistics.length>0){const i=window.LiveScoreApp.Utils.Cache,a=`${o}_ALL`,s=window.LiveScoreApp.Constants.getCacheTTL("STATISTICS",t?"finished":"live");return i.setToCacheByType(a,e,s,i.CACHE_PREFIX.STATISTIC),i.setToCacheByType(`${o}_1ST`,e,s,i.CACHE_PREFIX.STATISTIC),i.setToCacheByType(`${o}_2ND`,e,s,i.CACHE_PREFIX.STATISTIC),n.$(".statistics-tab").show(),!0}}catch(e){}return!1};setTimeout(function(){i().catch(e=>{})},1e3)}}catch(e){}if(window.LiveScoreApp.ModuleLoadStatus.addPendingAction(function(){const e=window.LiveScoreApp.Modules.MatchDetailsUI,t=(window.LiveScoreApp.Modules.MatchDetailsEvents,window.LiveScoreApp.Modules.MatchDetailsData);t.loadMatchDetails(o,r,function(a,s){const c=window.LiveScoreApp.Utils.SecurityUtils,l=c&&"function"==typeof c.validateMatchData?c.validateMatchData(s):s;if(a){let t=a;c&&"function"==typeof c.sanitizeHtml&&(t=c.sanitizeHtml(a)),n.$("#match-details").html(t).appendTo("body"),n.$("#match-details").removeClass("detail-closed"),n.$("#match-details").show(),m(o),i.onMatchDetailsOpen(),e.setupMatchDetailsUI(s.matchStatus||r.data("status"));const l=window.LiveScoreApp.ModuleLoader;return l&&"function"==typeof l.setupMatchDetailsEventListeners&&l.setupMatchDetailsEventListeners(o,{closeMatchDetails:function(e){window.LiveScoreApp.Modules.MatchDetails&&"function"==typeof window.LiveScoreApp.Modules.MatchDetails.closeMatchDetails&&window.LiveScoreApp.Modules.MatchDetails.closeMatchDetails()}}),void w(o)}const d=e.generateMatchDetailsHTML(l);n.$("#match-details").html(d).appendTo("body");var p=document.querySelector('.live-scores-match[data-match-id="'+o+'"]'),u=p?p.querySelector(".match-card__link"):null,h=document.getElementById("match-detail-expand"),f=document.getElementById("match-detail-expand-cta");if(u){var y=u.getAttribute("href");h&&(h.href=y,h.target="_blank",h.rel="noopener"),f&&(f.href=y,f.target="_blank",f.rel="noopener")}n.$("#match-details").removeClass("detail-closed"),n.$("#match-details").show(),m(o),i.onMatchDetailsOpen(),e.setupMatchDetailsUI(s.matchStatus);const g=window.LiveScoreApp.ModuleLoader;g&&"function"==typeof g.setupMatchDetailsEventListeners&&g.setupMatchDetailsEventListeners(o,{closeMatchDetails:function(e){window.LiveScoreApp.Modules.MatchDetails&&"function"==typeof window.LiveScoreApp.Modules.MatchDetails.closeMatchDetails&&window.LiveScoreApp.Modules.MatchDetails.closeMatchDetails()}}),v(o),t.fetchMatchDetailsFromServer(o,function(t){if((!window.LiveScoreApp.DetailClosingFlags||!window.LiveScoreApp.DetailClosingFlags.isClosing(o))&&!window.LiveScoreApp.detailClosing&&(window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null)===o&&t&&t.success){e.updateWithServerData(t,o),w(o);const n=t.data||{},i=!0===n.hasAttackMomentum;n.matchStatus,window.LiveScoreApp.currentMatchDetailsData||(window.LiveScoreApp.currentMatchDetailsData={}),window.LiveScoreApp.currentMatchDetailsData[o]={hasAttackMomentum:i,hasMatchIncidents:!0===n.hasMatchIncidents,homeManagerName:n.homeManagerName||null,awayManagerName:n.awayManagerName||null,customId:n.customId||null,matchStatus:n.matchStatus||"notstarted"},(n.homeManagerName||n.awayManagerName)&&"lineups"===(window.LiveScoreApp.Modules.MatchDetails?window.LiveScoreApp.Modules.MatchDetails.getCurrentTab():null)&&window.LiveScoreApp.Components?.Lineups?.applyManagerNamesFromStore&&window.LiveScoreApp.Components.Lineups.applyManagerNamesFromStore(o)}})})}),!window.LiveScoreApp.ModuleLoadStatus.areAllModulesReady()){a&&"function"==typeof a.getMatchDetailsSkeleton?n.$("#match-details").html(a.getMatchDetailsSkeleton()).appendTo("body"):window.LiveScoreApp.loadSkeletonUI?(n.$("#match-details").html('<div class="loading-spinner"></div>').appendTo("body"),window.LiveScoreApp.loadSkeletonUI(function(e){e&&n.$("#match-details").html(e.getMatchDetailsSkeleton())})):n.$("#match-details").html('<div class="loading-spinner"></div>').appendTo("body"),n.$("#match-details").show();let e="/wp-content/plugins/v7/js/";if(window.LiveScoresAjax&&window.LiveScoresAjax.plugin_url)e=window.LiveScoresAjax.plugin_url+"js/";else if(document.currentScript&&document.currentScript.src){const t=document.currentScript.src.match(/(.*\/js\/modules\/)/);t&&(e=t[1].replace(/\/modules\/$/,""))}else{const t=document.querySelectorAll("script[src]");for(const n of t)if(n.src.includes("match-details.js")){const t=n.src.match(/(.*\/js\/modules\/)/);if(t){e=t[1].replace(/\/modules\/$/,"");break}}if("/wp-content/plugins/v7/js/"===e)for(const n of t)if(n.src.includes("/plugins/")&&n.src.includes("/js/")){const t=n.src.match(/(.*(\/plugins\/[^\/]+\/)js\/)/);if(t){e=t[1].replace(/\/js\/$/,"/js/");break}}}const t=[{name:"MatchDetailsUI",path:"modules/match-details-ui.js"},{name:"MatchDetailsEvents",path:"modules/match-details-events.js"},{name:"MatchDetailsData",path:"modules/match-details-data.js",waitFor:"RequestQueue"},{name:"MatchDetailsTabs",path:"modules/match-details-tabs.js"},{name:"Standings",path:"modules/standings.js",namespace:"Components"},{name:"History",path:"modules/history.js",namespace:"Components"}];t.forEach(function(t){if((!t.waitFor||window.LiveScoreApp.Utils[t.waitFor])&&!window.LiveScoreApp.Modules[t.name]){const n=e+t.path+"?t="+Date.now();window.LiveScoreApp.ScriptManager.loadScript(n,t.name,{onLoad:function(){t.namespace,window.LiveScoreApp.ModuleLoadStatus.processActionsIfReady()},onError:function(e){}}).catch(e=>{})}}),t.forEach(function(t){if(t.waitFor&&window.LiveScoreApp.Utils[t.waitFor]&&!window.LiveScoreApp.Modules[t.name]){const n=e+t.path+"?t="+Date.now();window.LiveScoreApp.ScriptManager.loadScript(n,t.name,{onLoad:function(){window.LiveScoreApp.ModuleLoadStatus.processActionsIfReady()},onError:function(e){}}).catch(e=>{})}})}u=setTimeout(function(){u=null,t=!1},300)}else t=!1},updateMatchDetailScores:w,startDetailHeaderUpdatePolling:v,stopDetailHeaderUpdatePolling:f,updateTabContent:function(e,t){if(window.LiveScoreApp.ScriptManager.tabOpenCount++,window.LiveScoreApp.ScriptManager.tabOpenCount>=window.LiveScoreApp.ScriptManager.CLEANUP_THRESHOLD){const e=3e4;window.LiveScoreApp.ScriptManager.cleanupOldScripts(e),window.LiveScoreApp.ScriptManager.tabOpenCount=0}window.LiveScoreApp.Modules.MatchDetailsTabs&&window.LiveScoreApp.Modules.MatchDetailsTabs.updateTabContent(e,t)},checkAndFetchLineups:function(e){window.LiveScoreApp.Modules.MatchDetailsTabs&&window.LiveScoreApp.Modules.MatchDetailsTabs.checkAndFetchLineups(e)},checkAndFetchStandings:function(e){window.LiveScoreApp.Modules.MatchDetailsTabs&&window.LiveScoreApp.Modules.MatchDetailsTabs.checkAndFetchStandings(e)},getCurrentTab:function(){return e},setCurrentTab:function(t){e=t},clearTabCache:function(e){window.LiveScoreApp.Modules.MatchDetailsData&&window.LiveScoreApp.Modules.MatchDetailsData.clearTabCache(e)},closeMatchDetails:function(){if(t=!1,l){h();var i=d||window.location.pathname;d=null,history.replaceState({},"",i),"function"==typeof gtag&&gtag("event","page_view",{page_location:window.location.origin+i,page_path:i,page_title:document.title})}h();let a=null;if(window.LiveScoreApp.LiveScores&&"function"==typeof window.LiveScoreApp.LiveScores.getSelectedMatchId&&(a=window.LiveScoreApp.LiveScores.getSelectedMatchId()),a){const e=window.LiveScoreApp.Utils.RequestIdGenerator;e&&"function"==typeof e.cancelByMatchId&&e.cancelByMatchId(a),window.LiveScoreApp.DetailClosingFlags.set(a,!0,"closeMatchDetails"),window.LiveScoreApp.detailClosing=!0}if(window.momentumChart){try{window.momentumChart.destroy()}catch(e){}window.momentumChart=null}if(window.momentumChartData&&(window.momentumChartData=null),window.LiveScoreApp.ModuleLoadStatus&&window.LiveScoreApp.ModuleLoadStatus.pendingActions&&(window.LiveScoreApp.ModuleLoadStatus.pendingActions=[]),a&&window.LiveScoreApp.Modules.MatchDetailsData&&"function"==typeof window.LiveScoreApp.Modules.MatchDetailsData.clearTabCache&&window.LiveScoreApp.Modules.MatchDetailsData.clearTabCache(a,!0),f(),window.LiveScoreApp.Utils.MinuteCalculator&&"function"==typeof window.LiveScoreApp.Utils.MinuteCalculator.stopAutoUpdate&&window.LiveScoreApp.Utils.MinuteCalculator.stopAutoUpdate(),window.LiveScoreApp.Modules.MatchDetailsData&&"function"==typeof window.LiveScoreApp.Modules.MatchDetailsData.resetPreviousValues&&window.LiveScoreApp.Modules.MatchDetailsData.resetPreviousValues(),e=null,a&&window.LiveScoreApp.backgroundPreFetchInProgress&&delete window.LiveScoreApp.backgroundPreFetchInProgress[a],window.LiveScoreApp.LiveScores&&"function"==typeof window.LiveScoreApp.LiveScores.setSelectedMatchId){var o=window.LiveScoreApp.LiveScores.getSelectedMatchId();o&&o!=a||window.LiveScoreApp.LiveScores.setSelectedMatchId(null)}if(window.LiveScoreApp.Utils.EventUtils&&"function"==typeof window.LiveScoreApp.Utils.EventUtils.closeMatchDetails)window.LiveScoreApp.Utils.EventUtils.closeMatchDetails();else{const e=n.$("#match-details");e.length&&(e.addClass("detail-closed"),e.hide()),window.LiveScoreApp.Modules.MatchDetailsTabs&&window.LiveScoreApp.Modules.MatchDetailsTabs.cleanupIntervals()}const s=window.LiveScoreApp.Components||{};var r;s.MatchIncidents&&"function"==typeof s.MatchIncidents.cleanupIntervals&&s.MatchIncidents.cleanupIntervals(),s.AttackMomentum&&"function"==typeof s.AttackMomentum.cleanupIntervals&&s.AttackMomentum.cleanupIntervals(),s.Statistics&&"function"==typeof s.Statistics.cleanupIntervals&&s.Statistics.cleanupIntervals(),window.LiveScoreApp.Utils.RequestQueue&&"function"==typeof window.LiveScoreApp.Utils.RequestQueue.clearQueue&&window.LiveScoreApp.Utils.RequestQueue.clearQueue(),window.LiveScoreApp.ScriptManager&&setTimeout(function(){const e=window.LiveScoreApp.Config,t=e&&e.optimizationSettings._dynamicInfo,n=t&&t.basedOnLiveMatches>200?3e4:6e4;window.LiveScoreApp.ScriptManager.cleanupOldScripts(n)},100),r=a,p=setTimeout(function(){p=null;var e=window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null;e&&e!==r?r&&window.LiveScoreApp.DetailClosingFlags.clear(r,"closeMatchDetails-timeout"):(n.$("#attack-momentum-chart").length&&n.$("#attack-momentum-chart").css("display",""),n.$(".live-scores-tab-content").removeClass("live-scores-active entering exiting slide-left slide-right").css("display",""),n.$(".live-scores-menu-item").removeClass("active"),r&&window.LiveScoreApp.DetailClosingFlags.clear(r,"closeMatchDetails-timeout"),window.LiveScoreApp.detailClosing=!1)},150)},cleanupScripts:function(){if(window.LiveScoreApp.ScriptManager){const e=window.LiveScoreApp.Config,t=e&&e.optimizationSettings._dynamicInfo,n=t&&t.basedOnLiveMatches>200?6e4:3e5;return window.LiveScoreApp.ScriptManager.cleanupOldScripts(n)}return 0},emergencyScriptCleanup:function(){return window.LiveScoreApp.ScriptManager?(window.LiveScoreApp.ScriptManager.activeScripts.size,window.LiveScoreApp.ScriptManager.cleanupAllScripts()):0},getScriptStatus:function(){return window.LiveScoreApp.ScriptManager?window.LiveScoreApp.ScriptManager.getStatus():{error:"ScriptManager not available"}}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.MatchIncidents=function(){const e=window.LiveScoreApp.Utils.Cache,t=(window.LiveScoreApp.Config,window.LiveScoreApp.Utils.RequestQueue,window.LiveScoreApp.Utils.jQuery);window.LiveScoreApp.Utils.Compression;let n=null;function i(e){if(!e||"string"!=typeof e)return e||"";const t=document.createElement("div");return t.textContent=e,t.innerHTML}function a(e,t=""){return e&&(e.name||e.fullName||e.shortName)||t}function o(e,t,n="incident-player",i=""){const a=function(e,t){const n=parseInt(e||0,10);if(!n)return"";const i=function(e){if(!e||"string"!=typeof e)return"";let t=e.replace(/[İŞĞÜÖÇ]/g,function(e){return{"İ":"i","Ş":"s","Ğ":"g","Ü":"u","Ö":"o","Ç":"c"}[e]||e}).toLowerCase();return t=t.replace(/[şışğüöçâîûéèêëàáñóú]/g,function(e){return{"ş":"s","ı":"i","ğ":"g","ü":"u","ö":"o","ç":"c","â":"a","î":"i","û":"u","é":"e","è":"e","ê":"e","ë":"e","à":"a","á":"a","ñ":"n","ó":"o","ú":"u"}[e]||e}).replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),t}(t||"");return i?"/canli-skor/oyuncu/"+n+"/"+i:"/canli-skor/oyuncu/"+n+"/"}(t,i||e);return a?'<a href="'+a+'" class="'+n+' incident-player-link">'+e+"</a>":'<span class="'+n+'">'+e+"</span>"}function s(e,t="Oyuncu"){return e?e.player&&e.player.shortName?i(e.player.shortName):e.player&&e.player.fullName?i(e.player.fullName):e.player&&e.player.name?i(e.player.name):e.playerName?i(e.playerName):t:t}function r(e,t="Oyuncu"){return e?e.shortName?i(e.shortName):e.fullName?i(e.fullName):e.name?i(e.name):t:t}function c(i,a){a?n=null:(n=i,window.matchIncidentsUpdateInterval||(l(),window.matchIncidentsUpdateInterval=setInterval(function(){if("hidden"===document.visibilityState)return;const n=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails?window.LiveScoreApp.Modules.MatchDetails:null;if("details"===(n?n.getCurrentTab():null)){window.LiveScoreApp.Utils.RequestIdGenerator;const c=t.$("#match-incidents").children().clone(!0),l=c.length>0&&!c.hasClass("loading-spinner")&&!c.is("p"),d=`${i}_incidents`;e.deleteCacheItem(`${e.CACHE_PREFIX.MATCH_DETAIL}${d}`);var o=window.LiveScoresAjax&&window.LiveScoresAjax.ajax_url||"/wp-admin/admin-ajax.php",s=t.$('.live-scores-match[data-match-id="'+i+'"]').data("status")||"inprogress",r=new FormData;r.append("action","get_match_incidents"),r.append("match_id",i),r.append("match_status",s),r.append("force_fresh","1"),fetch(o,{method:"POST",body:r}).then(function(e){return e.json()}).then(function(o){var s=o&&o.success?o.data:null;if(s&&s.incidents&&s.incidents.length&&(window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null)===i&&n&&"details"===n.getCurrentTab()&&s.incidents.length>0){const n=a?"finished":"live",i=window.LiveScoreApp.Constants.getCacheTTL("MATCH_INCIDENTS",n);if(e.setToCacheByType(d,s.incidents,i,e.CACHE_PREFIX.MATCH_DETAIL),l){const e=u(s.incidents);e!==p&&(h(s.incidents),p=e,t.$("#match-incidents").addClass("content-refreshed"),setTimeout(function(){t.$("#match-incidents").removeClass("content-refreshed")},1500))}else h(s.incidents)}}).catch(function(e){})}},3e4),window.matchIncidentsUpdateInterval.matchId=i))}function l(){window.matchIncidentsUpdateInterval&&(clearInterval(window.matchIncidentsUpdateInterval),window.matchIncidentsUpdateInterval=null)}function d(n,i,a,o={}){const s=!0===o.isBackgroundFetch,r=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails?window.LiveScoreApp.Modules.MatchDetails:null,c=s?"details":r?r.getCurrentTab():null,l=t.$('.live-scores-match[data-match-id="'+n+'"]').data("status");if("notstarted"===l)return"details"!==c||s||t.$("#match-incidents").html("<p>Maç henüz başlamamış, olaylar mevcut değil.</p>"),void a(!1);const d=`${n}_incidents`,p=e.getFromCacheByType(d,e.CACHE_PREFIX.MATCH_DETAIL);if(p&&Array.isArray(p)){if(s){const e=Array.isArray(p)&&p.length>0;return a(e),Promise.resolve()}if("function"==typeof t.$("#match-incidents").html&&"details"===c)return h(p),Promise.resolve().then(()=>{const e=Array.isArray(p)&&p.length>0;a(e)}),Promise.resolve()}return s||"details"!==c||t.$("#match-incidents").empty(),("undefined"!=typeof QueuedAjax&&QueuedAjax?QueuedAjax.request("get_match_incidents",{match_id:n,match_status:l||""}):t.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:{action:"get_match_incidents",match_id:n,match_status:l||"",nonce:window.liveScoresNonce||""}})).then(function(o){if(!window.LiveScoreApp.detailClosing)if(o&&o.success&&o.data){let r=[];if(Array.isArray(o.data)?r=o.data:o.data.incidents&&Array.isArray(o.data.incidents)?r=o.data.incidents:o.data.incidents&&"object"==typeof o.data.incidents&&o.data.incidents.incidents&&Array.isArray(o.data.incidents.incidents)&&(r=o.data.incidents.incidents),0===r.length&&window.momentumChartData&&Array.isArray(window.momentumChartData.incidents)&&window.momentumChartData.incidents.length>0&&window.momentumChartData.matchId===n&&(r=window.momentumChartData.incidents),0===r.length&&setTimeout(function(){if(window.momentumChartData&&Array.isArray(window.momentumChartData.incidents)&&window.momentumChartData.incidents.length>0&&window.momentumChartData.matchId===n){const t=window.momentumChartData.incidents,n=i?"finished":"live",a=window.LiveScoreApp.Constants.getCacheTTL("MATCH_INCIDENTS",n);e.setToCacheByType(d,t,a,e.CACHE_PREFIX.MATCH_DETAIL),"details"===c&&h(t)}},500),r.length>0){const t=i?"finished":"live",n=window.LiveScoreApp.Constants.getCacheTTL("MATCH_INCIDENTS",t);e.setToCacheByType(d,r,n,e.CACHE_PREFIX.MATCH_DETAIL),"details"!==c||s||h(r),Promise.resolve().then(()=>{const e=Array.isArray(r)&&r.length>0;a(e)})}else o.data.message?("details"!==c||s||t.$("#match-incidents").html("<p>"+o.data.message+"</p>"),a(!1)):("details"!==c||s||t.$("#match-incidents").html("<p>Bu maç için maç olayları verisi bulunamadı.</p>"),a(!1))}else"details"!==c||s||t.$("#match-incidents").html("<p>Bu maç için maç olayları verisi bulunamadı.</p>"),a(!1)}).catch(function(e){s||"details"!==c||t.$("#match-incidents").html("<p>Maç olayları yüklenirken bir hata oluştu. Lütfen daha sonra tekrar deneyin.</p>"),a(!1)})}let p=null;function u(e){return e&&e.length?e.map(function(e){return[e.incidentType||"",e.time||"",e.addedTime||"",e.isHome?"1":"0",e.homeScore||"",e.awayScore||"",e.incidentClass||"",e.player?e.player.shortName||e.player.name||"":e.playerName||"",e.text||"",e.status||""].join("|")}).join(";;"):""}function m(e,t,n,i){let a=e?e+", ":"";return"goal"===t?a+="Goal by "+(n||"Unknown player"):"card"===t?a+="Card given to "+(n||"Unknown player"):"substitution"===t?a+="Substitution: "+(n||"Unknown player"):"varDecision"===t?a+="VAR Decision: "+(n||"Review"):"penaltyShootout"===t&&(a+="Penalty: "+(n||"Unknown player")),i&&(a+=", Score: "+i),a}function h(e){window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails&&window.LiveScoreApp.Modules.MatchDetails;const n=window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null,c=n?window.LiveScoreApp._playerTeamMap&&window.LiveScoreApp._playerTeamMap[n]:null;c&&e.forEach(function(e){if("period"!==e.incidentType&&"injuryTime"!==e.incidentType){var t=e.player&&e.player.id||e.playerIn&&e.playerIn.id||e.playerOut&&e.playerOut.id;t&&void 0!==c[t]&&e.isHome!==c[t]&&(e.isHome=c[t])}});let l="";e.forEach(function(e){let t="";"penaltyShootout"!==e.incidentType&&(void 0!==e.time&&null!==e.time&&e.time<0?t="Kulübede":(t=e.time?e.time+"'":"",e.addedTime&&999!==e.addedTime&&(t+=" +"+e.addedTime)));const n=e.incidentType;e.isHome;let c="",d="";if("period"===n)"HT"===e.text?(t="İlk Yarı Sonu "+e.homeScore+" - "+e.awayScore,d='<article class="incident general-incident" style="background-color: #e0e0e0;" role="status" aria-label="İlk Yarı Sonu '+e.homeScore+" - "+e.awayScore+'"><time class="incident-details center-incident">'+t+"</time></article>"):"FT"===e.text?(t="Maç Sonu "+e.homeScore+" - "+e.awayScore,d='<article class="incident general-incident" style="background-color: #e0e0e0;" role="status" aria-label="Maç Sonu '+e.homeScore+" - "+e.awayScore+'"><time class="incident-details center-incident">'+t+"</time></article>"):"ET"===e.text?(t="Uzatma Sonu "+e.homeScore+" - "+e.awayScore,d='<article class="incident general-incident" style="background-color: #e0e0e0;" role="status" aria-label="Uzatma Sonu '+e.homeScore+" - "+e.awayScore+'"><time class="incident-details center-incident">'+t+"</time></article>"):"PEN"===e.text&&(t="Penaltılar "+e.homeScore+" - "+e.awayScore,d='<article class="incident general-incident" style="background-color: #e0e0e0;" role="status" aria-label="Penaltılar '+e.homeScore+" - "+e.awayScore+'"><time class="incident-details center-incident">'+t+"</time></article>");else if("injuryTime"===n){const t=window.translations&&window.translations.playerstatistics&&window.translations.playerstatistics.mins?window.translations.playerstatistics.mins:"dakika",n="+"+e.length+" "+t;d='<article class="incident general-incident" role="status" aria-label="Injury time '+n+'"><time class="incident-details center-incident">'+n+"</time></article>"}else if("penaltyShootout"===n){const t=e.player?i(e.player.shortName):e.playerName?i(e.playerName):"-",n=o(t,e.player&&e.player.id?e.player.id:0,"incident-player",a(e.player,t));"scored"===e.incidentClass?c='<i class="fas fa-futbol goal-icon"></i>':"missed"===e.incidentClass?c='<i class="fas fa-times-circle penalty-missed-icon"></i>':"goalkeeperSave"===e.incidentClass&&(c='<i class="fas fa-hand-paper goalkeeper-save-icon"></i>');const s=e.homeScore+" - "+e.awayScore;d=e.isHome?'<article class="incident home-incident" aria-label="'+m("Penalty","penaltyShootout",t,s)+'"><time class="incident-time">PEN</time><p class="incident-details home-incident">'+c+" "+n+' <span class="incident-score">'+s+"</span></p></article>":'<article class="incident away-incident" aria-label="'+m("Penalty","penaltyShootout",t,s)+'"><p class="incident-details away-incident"><span class="incident-score">'+s+"</span> "+n+" "+c+'</p><time class="incident-time">PEN</time></article>'}else if("varDecision"===n){c='<i class="fas fa-tv var-icon"></i>';let n="";const s=window.translations&&window.translations.matchIncidents&&window.translations.matchIncidents.varDecision||{};if("penaltyNotAwarded"===e.incidentClass?n=!1===e.confirmed?s.penaltyNotAwarded_pending||"Penaltı İncelemesi":s.penaltyNotAwarded_confirmed||"Penaltı İptal Edildi":"redCardGiven"===e.incidentClass?n=!1===e.confirmed?s.redCardGiven_cancelled||"Kırmızı Kart İptal Edildi":s.redCardGiven_confirmed||"Kırmızı Kart Onaylandı":"redCardCancelled"===e.incidentClass?n=s.redCardCancelled||"Kırmızı Kart İptal Edildi":"penaltyAwarded"===e.incidentClass?n=!1===e.confirmed?s.penaltyAwarded_cancelled||"Penaltı İptal Edildi":s.penaltyAwarded_confirmed||"Penaltı Verildi":"cardUpgrade"===e.incidentClass?n=!1===e.confirmed?s.cardUpgrade_cancelled||"Kart Değişikliği İptal Edildi":s.cardUpgrade_confirmed||"Kart Yükseltildi":"cardDowngrade"===e.incidentClass?n=!1===e.confirmed?s.cardDowngrade_cancelled||"Kart Değişikliği İptal Edildi":s.cardDowngrade_confirmed||"Kart İndirildi":"goalNotAwarded"===e.incidentClass?(n=s.goalNotAwarded||"VAR - Gol İptal",c='<i class="fas fa-futbol cancelled-goal-icon"></i> <i class="fas fa-tv var-icon"></i>'):"goalAwarded"===e.incidentClass?(n=!1===e.confirmed?s.goalAwarded_cancelled||"VAR - Gol İptal":s.goalAwarded_confirmed||"VAR - Gol Onaylandı",c='<i class="fas fa-futbol '+(!1===e.confirmed?"cancelled-goal-icon":"goal-icon")+'"></i> <i class="fas fa-tv var-icon"></i>'):n=!1===e.confirmed?s.default_cancelled||"VAR İncelemesi Sonrası İptal":s.default_confirmed||"VAR İncelemesi Sonrası Onay",e.isHome){const s=void 0!==e.homeScore&&void 0!==e.awayScore?e.homeScore+" - "+e.awayScore:"",r=e.player?i(e.player.shortName||e.player.name||""):"-",l=o(r,e.player&&e.player.id?e.player.id:0,"incident-player",a(e.player,r));d='<article class="incident home-incident" aria-label="'+m(t,"varDecision",r,s)+'"><time class="incident-time">'+t+'</time><p class="incident-details home-incident">'+c+" "+n+' <span class="incident-score">'+s+"</span> "+l+"</p></article>"}else{const s=void 0!==e.homeScore&&void 0!==e.awayScore?e.homeScore+" - "+e.awayScore:"",r=e.player?i(e.player.shortName||e.player.name||""):"-",l=o(r,e.player&&e.player.id?e.player.id:0,"incident-player",a(e.player,r));d='<article class="incident away-incident" aria-label="'+m(t,"varDecision",r,s)+'"><p class="incident-details away-incident">'+l+" "+n+' <span class="incident-score">'+s+"</span> "+c+'</p><time class="incident-time">'+t+"</time></article>"}}else{const l="cancelled"===e.status||!0===e.isCancelled;let p;c=function(e,t,n){if("goal"===e)return n?'<i class="fas fa-times-circle cancelled-goal-icon" title="İptal edilen gol"></i>':"penalty"===t?'<i class="fas fa-futbol penalty-goal-icon"></i>':"ownGoal"===t?'<i class="fas fa-futbol own-goal-icon" style="color: red;"></i>':'<i class="fas fa-futbol goal-icon"></i>';if("card"===e){if("yellow"===t)return'<i class="fas fa-square yellow-card-icon"></i>';if("red"===t||"secondYellow"===t)return'<i class="fas fa-square red-card-icon"></i>';if("yellowRed"===t)return'<i class="fas fa-square yellow-card-icon"></i> <i class="fas fa-square red-card-icon"></i>'}else{if("substitution"===e)return'<i class="fas fa-exchange-alt incident-substitution-icon"></i>';if("inGamePenalty"===e&&"missed"===t)return'<i class="fas fa-times-circle penalty-missed-icon"></i>'}return""}(n,e.incidentClass,l),p="goal"===n?s(e,"Gol"):"card"===n?s(e,"Kart"):"inGamePenalty"===n?s(e,"Penaltı"):s(e);let u="";"goal"===n&&(u+=" match-incident--goal"),"card"!==n||"red"!==e.incidentClass&&"secondYellow"!==e.incidentClass&&"yellowRed"!==e.incidentClass||(u+=" match-incident--red-card");const h=e.player&&e.player.id?e.player.id:0,w=e.assist1||e.playerAssist,v=w?i(w.shortName||w.name||""):"",f=w&&w.id||0;let y="";if("goal"!==n||l||("ownGoal"===e.incidentClass?y="Kendi Kalesine Gol":"penalty"===e.incidentClass?y="Penaltı":v&&(y="Asist: "+(f>0?o(v,f,"incident-player",a(w,v)):v))),e.isHome){if(d='<article class="incident home-incident'+u+(l?" cancelled-incident":"")+'" aria-label="'+m(t,n,p,void 0!==e.homeScore?e.homeScore+" - "+e.awayScore:"")+'"><time class="incident-time">'+t+'</time><p class="incident-details home-incident">'+c,"goal"===n||"card"===n||"inGamePenalty"===n)"goal"===n&&void 0!==e.homeScore&&void 0!==e.awayScore&&(d+='<span class="incident-score">'+e.homeScore+" - "+e.awayScore+"</span>"),d+=l?'<span class="incident-player"><s>'+p+"</s></span>":o(p,h,"incident-player",a(e.player,p)),y&&(d+='<span class="assist">('+y+")</span>");else if("substitution"===n){const t=r(e.playerOut),n=r(e.playerIn),i=e.playerOut&&e.playerOut.id?e.playerOut.id:0,s=e.playerIn&&e.playerIn.id?e.playerIn.id:0;d+=o(t,i,"incident-player-out",a(e.playerOut,t)),d+='<i class="fas fa-arrow-right"></i>',d+=o(n,s,"incident-player-in",a(e.playerIn,n))}d+="</p></article>"}else{if(d='<article class="incident away-incident'+u+(l?" cancelled-incident":"")+'" aria-label="'+m(t,n,p,void 0!==e.homeScore?e.homeScore+" - "+e.awayScore:"")+'"><p class="incident-details away-incident">',"goal"===n||"card"===n||"inGamePenalty"===n)"goal"===n&&void 0!==e.homeScore&&void 0!==e.awayScore&&(d+='<span class="incident-score">'+e.homeScore+" - "+e.awayScore+"</span>"),d+=l?'<span class="incident-player"><s>'+p+"</s></span>":o(p,h,"incident-player",a(e.player,p)),y&&(d+='<span class="assist">('+y+")</span>");else if("substitution"===n){const t=r(e.playerOut),n=r(e.playerIn),i=e.playerOut&&e.playerOut.id?e.playerOut.id:0,s=e.playerIn&&e.playerIn.id?e.playerIn.id:0;d+=o(t,i,"incident-player-out",a(e.playerOut,t)),d+='<i class="fas fa-arrow-right"></i>',d+=o(n,s,"incident-player-in",a(e.playerIn,n))}d+=" "+c+'</p><time class="incident-time">'+t+"</time></article>"}}l+=d}),""===l?(t.$("#match-incidents").html(""),p=""):(t.$("#match-incidents").html(l),p=u(e))}return"undefined"!=typeof window&&(window.addEventListener("beforeunload",l),window.addEventListener("unload",l),document.addEventListener("visibilitychange",function(){document.hidden?l():n&&!window.matchIncidentsUpdateInterval&&c(n,!1)})),{fetchMatchIncidents:d,renderMatchIncidents:h,updateMatchIncidentsTab:function(e,t,n,i={}){if(window.LiveScoreApp.detailClosing)return void(n&&n(!1));const a=window.LiveScoreApp.Utils.RequestIdGenerator;return a&&a.generateId(e,"get_match_incidents"),d(e,t,function(i){n&&n(i),t||c(e,t)},i)},setupAutoUpdate:c,cleanupIntervals:l}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.PullToRefresh=function(){var e=!1,t=null,n=0,i=0,a=!1,o=!1,s=null;function r(e){if(!(o||e.touches.length>1)){var t=document.getElementById("match-details");t&&!t.classList.contains("detail-closed")&&""!==t.innerHTML.trim()||(window.pageYOffset||document.documentElement.scrollTop)>5||(n=e.touches[0].clientY,a=!0)}}function c(e){if(a&&!o){var t=.4*(e.touches[0].clientY-n);if(t<0)return a=!1,void(s&&(s.style.height="0",s.classList.remove("pulling")));if((window.pageYOffset||document.documentElement.scrollTop)>5)a=!1;else if(t>10&&e.preventDefault(),i=Math.min(t,120),s){s.classList.add("pulling"),s.style.height=i+"px";var r=s.querySelector(".ptr-text");r&&(r.textContent=i>=70?"Bırakın yenilensin":"Yenilemek için çekin");var c=s.querySelector(".ptr-spinner");if(c){var l=i/120*360;c.style.transform="rotate("+l+"deg)"}}}}function l(){a&&(a=!1,i>=70&&!o?function(){if(o=!0,s){s.classList.remove("pulling"),s.classList.add("refreshing");var e=s.querySelector(".ptr-text");e&&(e.textContent="Yenileniyor...")}var t=window.LiveScoreApp.LiveScores;if(t&&"function"==typeof t.fetchLiveScores)if(t.getIsAllMatchesSelected&&t.getIsAllMatchesSelected()){var n=window.LiveScoreApp.Utils.jQuery.$("#date-picker").val();if(n){var i=n.split("/");t.fetchLiveScores(i[0],i[1],i[2],"all")}}else t.fetchLiveScores(null,null,null,"live");setTimeout(function(){o=!1,d()},1500)}():d(),i=0)}function d(){s&&(s.classList.remove("pulling","refreshing"),s.style.height="0")}return{init:function(){var n=window.LiveScoreApp.Utils.DeviceDetect;if((!n||n.isTouchDevice())&&!e){e=!0,function(){if(!s){(s=document.createElement("div")).className="ptr-indicator",s.innerHTML='<div class="ptr-spinner"></div><span class="ptr-text">Yenilemek için çekin</span>';var e=document.createElement("style");e.textContent=[".ptr-indicator {","  position: fixed; top: 0; left: 0; right: 0;","  height: 0; overflow: hidden;","  display: flex; align-items: center; justify-content: center; gap: 8px;","  background: linear-gradient(135deg, #e3f2fd, #bbdefb);","  color: #1565c0; font-size: 13px; font-weight: 600;","  z-index: 10000; transition: height 0.2s ease;","  box-shadow: 0 2px 8px rgba(0,0,0,0.1);","}",".ptr-indicator.pulling { transition: none; }",".ptr-indicator.refreshing { height: 50px !important; }",".ptr-spinner {","  width: 20px; height: 20px;","  border: 2px solid #90caf9; border-top-color: #1565c0;","  border-radius: 50%;","}",".ptr-indicator.refreshing .ptr-spinner {","  animation: ptr-spin 0.8s linear infinite;","}","@keyframes ptr-spin { to { transform: rotate(360deg); }}","@media (prefers-reduced-motion: reduce){","  .ptr-spinner { animation: none !important; }","}"].join("\n"),document.head.appendChild(e),document.body.appendChild(s)}}(),t&&t.abort();var i=(t=new AbortController).signal;document.getElementById("live-scores")&&(document.addEventListener("touchstart",r,{passive:!0,signal:i}),document.addEventListener("touchmove",c,{passive:!1,signal:i}),document.addEventListener("touchend",l,{passive:!0,signal:i}))}},destroy:function(){t&&(t.abort(),t=null),s&&s.parentNode&&(s.parentNode.removeChild(s),s=null),e=!1,o=!1,a=!1}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.StatisticsModules=window.LiveScoreApp.Components.StatisticsModules||{},window.LiveScoreApp.Components.StatisticsModules.Data=function(){let e,t,n,i,a,o=null;function s(){try{return e=window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.Cache,t=window.LiveScoreApp.Config||{},n=window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.RequestQueue,i=window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.jQuery,a=window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.RequestIdGenerator,!!(e&&n&&i)}catch(e){return!1}}let r=s();function c(t,n,o=!0,c="ALL"){return new Promise(async(o,l)=>{try{if(r||(r=s()),!r)return l(new Error("Gerekli modüller bulunamadı"));if(!window.LiveScoresAjax)return l(new Error("LiveScoresAjax bulunamadı"));const d=t+"_"+c,p=e.getFromCacheByType(d,e.CACHE_PREFIX.STATISTIC);if(p)return o(p);try{const s=a?a.generateId(t,"get_match_statistics_"+c):null;let r=await("undefined"!=typeof QueuedAjax&&QueuedAjax?QueuedAjax.request("get_match_statistics",{match_id:t,period:c,match_status:n?"finished":"live",request_id:s}):i.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:{action:"get_match_statistics",match_id:t,period:c,match_status:n?"finished":"live",request_id:s,nonce:window.liveScoresNonce||""}}));if(r&&void 0!==r.success&&r.data&&(r=r.data),r&&r.statistics&&r.statistics.length>0){const t=n?"finished":"live",i=window.LiveScoreApp.Constants.getCacheTTL("STATISTICS",t);return e.setToCacheByType(d,r,i,e.CACHE_PREFIX.STATISTIC),o(r)}return e.setToCacheByType(d,{noData:!0},6e4,e.CACHE_PREFIX.STATISTIC),o({noData:!0})}catch(e){return l(e)}}catch(e){return l(e)}})}return{fetchStatistics:c,fetchStatisticsSilently:function(e,t,n="ALL"){return c(e,t,!1,n)},cancelActiveRequest:function(){return!(!o||"function"!=typeof o.abort||(o.abort(),o=null,0))}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.StatisticsModules=window.LiveScoreApp.Components.StatisticsModules||{},window.LiveScoreApp.Components.StatisticsModules.UI=function(){const e=window.LiveScoreApp.Utils.jQuery,t=window.LiveScoreApp.Utils.Translator,n=window.LiveScoreApp.Utils?.SecurityUtils;window.LiveScoreApp.Components&&window.LiveScoreApp.Components.Skeleton;let i=!1;async function a(t=""){if(e&&e.$&&e.$(".statistics-tab").is(":hidden"))return;const n=`\n            <div class="statistics-error-container" style="padding: 15px; border: 1px solid #f5c6cb; border-radius: 6px; background-color: #f8d7da; color: #721c24; margin: 10px 0;">\n                <h4 style="margin-top: 0;">İstatistik Bilgisi Alınamadı</h4>\n                <p>${t||"İstatistik bilgisi alınamadı. Lütfen daha sonra tekrar deneyin."}</p>\n                <button id="statistics-retry-button" style="background-color: #007bff; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; margin-top: 10px;">Yeniden Dene</button>\n            </div>\n        `;return e.$("#tab-statistics").html(n),e.$("#statistics-retry-button").on("click",function(){const t=e.$("#match-details").data("match-id");if(t){if(window.LiveScoreApp.Utils.Cache){const e=window.LiveScoreApp.Utils.Cache.CACHE_PREFIX.STATISTIC+t;window.LiveScoreApp.Utils.Cache.deleteCacheItem(e)}if("function"==typeof window.refreshStatisticsTabNow)window.refreshStatisticsTabNow(t);else{const n=window.LiveScoreApp.Components.Statistics;n&&"function"==typeof n.updateStatisticsTab?n.updateStatisticsTab(t):e.$("#tab-statistics").html("<p>Yeniden deneme başarısız. Sayfayı yenileyip tekrar deneyiniz.</p>")}}}),Promise.resolve()}async function o(t){try{if(!t)return await a("Cevap boş alındı"),!1;if(!t.statistics)return e.$("#tab-statistics").html('<div style="background:#f5f5f5; padding:10px; font-size:12px; overflow:auto; max-height:300px;"><pre>API Response Debug:\n'+JSON.stringify(t,null,2).substring(0,1e3)+"...</pre></div>"),await a("API response format bilinmiyor. Lütfen geliştiriciyle iletişime geçin."),!1;if(!Array.isArray(t.statistics))return await a("İstatistik verisi dizi formunda değil"),!1;if(0===t.statistics.length)return e.$("#tab-statistics").html("<p>Bu maç için istatistik verisi mevcut değil.</p>"),!0;e.$("#tab-statistics").empty();const n='\n                <div class="statistics-period-selection">\n                    <button id="all-period" class="active">TÜMÜ</button>\n                    <button id="first-half">1. Yarı</button>\n                    <button id="second-half">2. Yarı</button>\n                </div>\n                <div id="statistics-content"></div>\n            ';e.$("#tab-statistics").html(n);let i=t.statistics.some(e=>"ALL"===e.period),o=t.statistics.some(e=>"1ST"===e.period),r=t.statistics.some(e=>"2ND"===e.period);return i||e.$("#all-period").hide(),o||e.$("#first-half").hide(),r||e.$("#second-half").hide(),await s(t,"ALL"),e.$("#all-period").addClass("active"),!0}catch(e){return await a("İstatistik görünümü hazırlanırken hata oluştu."),!1}}async function s(n,a){try{if(i)return!1;i=!0;let o='<div class="live-scores-statistics-content">',s=!0;return n&&n.statistics&&Array.isArray(n.statistics)?n.statistics.forEach(function(e){e&&"object"==typeof e&&e.period===a&&e.groups&&Array.isArray(e.groups)&&e.groups.length>0&&(s=!1,e.groups.forEach(function(e){e&&"object"==typeof e&&(o+=`<div class="live-scores-stat-group"><h4>${t.translateName("statistics",e.groupName)}</h4>`,e.statisticsItems&&Array.isArray(e.statisticsItems)&&e.statisticsItems.length>0?e.statisticsItems.forEach(function(e){e&&"object"==typeof e&&(2===e.renderType?o+=c(e):o+=r(e))}):o+="<p>Bu grup için istatistik verisi bulunamadı.</p>",o+="</div>")}))}):s=!0,s&&(o+="<p>Bu periyot için istatistik verisi bulunamadı.</p>"),o+="</div>",e.$("#statistics-content").html(o),i=!1,!0}catch(e){return i=!1,!1}}function r(e){const i=parseFloat(e.homeValue)||0,a=parseFloat(e.awayValue)||0,o=i+a,s=0===o?50:Math.round(i/o*100),r=0===o?50:100-s,c=i>a?" higher":"",l=a>i?" higher":"",d=n?.escapeHtml(e.name)||e.name;return`\n            <div class="live-scores-stat-row">\n                <div class="live-scores-stat-label">${t.translateName("statistics",d)}</div>\n                <div class="live-scores-stat-bar-container">\n                    <div class="live-scores-stat-bar home${c}" style="width:${s}%;">\n                        <span class="live-scores-stat-value home${c}">${Number.isInteger(i)?i:i.toFixed(2)}</span>\n                    </div>\n                    <div class="live-scores-stat-bar away${l}" style="width:${r}%;">\n                        <span class="live-scores-stat-value away${l}">${Number.isInteger(a)?a:a.toFixed(2)}</span>\n                    </div>\n                </div>\n            </div>\n        `}function c(e){let n=0,i=0;if("number"==typeof e.homeValue&&"number"==typeof e.awayValue)n=e.homeValue,i=e.awayValue;else if("string"==typeof e.home&&e.home.includes("%"))n=parseInt(e.home)||0,i=parseInt(e.away)||0;else{const t=/(\d+)\/(\d+)\s*\((\d+)%\)/,a=/(\d+)\/(\d+)\s*\((\d+)%\)/,o="string"==typeof e.home?e.home.match(t):null,s="string"==typeof e.away?e.away.match(a):null;if(o&&s)n=parseInt(o[3])||0,i=parseInt(s[3])||0;else{if("number"!=typeof e.homeValue||"number"!=typeof e.awayValue)return r(e);n=e.homeValue,i=e.awayValue}}const a=n>i?"higher":"",o=i>n?"higher":"",s=n+i;return`\n            <div class="live-scores-stat-row circular-stat">\n                <div class="live-scores-stat-label">${t.translateName("statistics",e.name)}</div>\n                <div class="circular-stat-container">\n                    <div class="circular-stat-item">\n                        <svg viewBox="0 0 36 36" class="circular-chart ${a}">\n                            <circle class="circle-bg" cx="18" cy="18" r="15.9155" />\n                            <circle class="circle home-circle" cx="18" cy="18" r="15.9155" \n                                    style="stroke-dasharray: ${n}, ${s};" />\n                            <text x="18" y="20.35" class="percentage">${n}%</text>\n                        </svg>\n                    </div>\n                    <div class="circular-stat-item">\n                        <svg viewBox="0 0 36 36" class="circular-chart ${o}">\n                            <circle class="circle-bg" cx="18" cy="18" r="15.9155" />\n                            <circle class="circle away-circle" cx="18" cy="18" r="15.9155" \n                                    style="stroke-dasharray: ${i}, ${s};" />\n                            <text x="18" y="20.35" class="percentage">${i}%</text>\n                        </svg>\n                    </div>\n                </div>\n            </div>\n        `}return{showLoadingState:function(){return new Promise(e=>{e(!0)})},showErrorState:a,initializeStatistics:o,renderStatistics:s,renderBarStat:r,renderCircularStat:c,updateStatisticsTab:async function(e){try{const e=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails?window.LiveScoreApp.Modules.MatchDetails:null;return!(!e||"statistics"!==e.getCurrentTab())}catch(e){return!1}},renderContent:async function(t){try{if("string"==typeof t)return e.$("#tab-statistics").html(t),!0;if(!t)return await a("Veri alınamadı"),!1;const n=window.LiveScoreApp.Components.StatisticsModules.Utils;return n&&"function"==typeof n.isValidStatisticsData&&!n.isValidStatisticsData(t)?(await a("Geçersiz istatistik verisi"),!1):await o(t)}catch(e){return await a("İçerik hazırlanırken hata oluştu."),!1}},silentUpdateContent:async function(t){try{if(!t)return!1;if("string"==typeof t){if(t.trim().startsWith("<"))return e.$("#tab-statistics").html(t),!0;try{t=JSON.parse(t)}catch(e){return!1}}if(!t.statistics)return!1;if(!Array.isArray(t.statistics)){if("object"!=typeof t.statistics)return!1;t.statistics=[t.statistics]}if(!t.statistics.some(e=>e&&"string"==typeof e.period&&["ALL","1ST","2ND"].includes(e.period)&&e.groups&&Array.isArray(e.groups)))return!1;const n=e.$(".statistics-period-selection button.active");let i="ALL";if(n.length){const e=n.attr("id");"first-half"===e?i="1ST":"second-half"===e&&(i="2ND")}const a=e.$("#statistics-content").scrollTop(),o=e.$("#statistics-content .live-scores-stat-row:hover").length>0?e.$("#statistics-content .live-scores-stat-row:hover").index():-1;if(!await s(t,i))return!1;if(e.$("#statistics-content").scrollTop(a),-1!==o)try{e.$("#statistics-content .live-scores-stat-row").eq(o).addClass("just-updated"),setTimeout(()=>{e.$("#statistics-content .just-updated").removeClass("just-updated")},100)}catch(e){}return!0}catch(e){return!1}},getCurrentActivePeriod:function(){const t=e.$(".statistics-period-selection button.active");if(t.length){const e=t.attr("id");if("first-half"===e)return"1ST";if("second-half"===e)return"2ND"}return"ALL"}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.StatisticsModules=window.LiveScoreApp.Components.StatisticsModules||{},window.LiveScoreApp.Components.StatisticsModules.Events=function(){const e=window.LiveScoreApp.Utils.jQuery;let t={isProcessing:!1};async function n(t){try{return e.$(".statistics-period-selection button").removeClass("active"),e.$(t).addClass("active"),!0}catch(e){return!1}}async function i(i){try{const a=window.LiveScoreApp.Components.StatisticsModules.UI;return e.$(".statistics-period-selection").off("click"),e.$(".statistics-period-selection").on("click","button",async function(o){if(!t.isProcessing){t.isProcessing=!0;try{const t=e.$(this),o=t.attr("id");if(!t.hasClass("active")&&a&&"function"==typeof a.renderStatistics){let e="ALL";"first-half"===o?e="1ST":"second-half"===o&&(e="2ND"),await a.renderStatistics(i,e),await n(this)}}catch(e){}finally{t.isProcessing=!1}}}),!0}catch(e){return!1}}async function a(e){try{return!!e&&await i(e)}catch(e){return!1}}async function o(){try{return e.$("#all-period, #first-half, #second-half").off("click"),t.isProcessing=!1,!0}catch(e){return!1}}return{setActiveButton:n,setupPeriodButtons:i,setupEventListeners:a,cleanupEventListeners:o,initializeEvents:async function(e){try{return await o(),!e||await a(e)}catch(e){return!1}}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.StatisticsModules=window.LiveScoreApp.Components.StatisticsModules||{},window.LiveScoreApp.Components.StatisticsModules.Utils=function(){const e=window.LiveScoreApp.Utils.Translator;function t(e){if(!e||"object"!=typeof e)return!1;if(!Array.isArray(e.statistics))return!1;if(0===e.statistics.length)return!0;return e.statistics.every(e=>!(!e||"object"!=typeof e)&&(!(!e.period||"string"!=typeof e.period)&&(!["period"].some(t=>{const n=e[t];if(!n||"string"!=typeof n)return!1;const i=n.toLowerCase();return i.includes("<script")||i.includes("onerror=")||i.includes("onload=")||i.includes("javascript:")})&&(e.groups&&Array.isArray(e.groups),!0))))}async function n(e){try{return t(e)}catch(e){return!1}}function i(e,n){if(!t(e))return[];const i=e.statistics.filter(e=>e.period===n);return i.length>0?i:[]}async function a(e,t){try{return i(e,t)}catch(e){return[]}}function o(t,n){try{return e&&"function"==typeof e.translateName&&e.translateName(t,n)||n}catch(e){return n}}function s(e){if(!Array.isArray(e))return[];const t=["possession","shots","shotsOnTarget","corners","fouls","yellowCards","redCards","offsides","passes"];return[...e].sort((e,n)=>{const i=t.indexOf(e.groupName),a=t.indexOf(n.groupName);return-1!==i&&-1!==a?i-a:-1!==i?-1:-1!==a?1:e.groupName.localeCompare(n.groupName)})}return{isValidStatisticsData:t,filterStatisticsByPeriod:i,calculatePercentage:function(e,t,n=0){if("number"==typeof e&&"number"==typeof t||(e=parseFloat(e)||0,t=parseFloat(t)||0),0===t)return n;const i=e/t*100;return Math.round(i)},safeParseFloat:function(e){if("number"==typeof e)return e;if(!e||"-"===e)return 0;const t=parseFloat(e.toString().replace(/[^\d.-]/g,""));return isNaN(t)?0:t},safeTranslate:o,parseCircularStatValue:function(e){if(!e||"string"!=typeof e)return null;const t=e.match(/(\d+)\/(\d+)\s*\((\d+)%\)/);return t&&4===t.length?{value:parseInt(t[1]),total:parseInt(t[2]),percentage:parseInt(t[3])}:null},sortStatisticGroups:s,validateStatisticsData:n,filterStatisticsByPeriodAsync:a,translateAsync:async function(e,t){try{return o(e,t)}catch(e){return t}},sortStatisticGroupsAsync:async function(e){try{return s(e)}catch(t){return Array.isArray(e)?[...e]:[]}},processStatisticsData:async function(e,t,i=null){try{if(!await n(e))throw new Error("Geçersiz istatistik verisi");const s=await a(e,t);if(i&&s.length>0&&s[0].groups){const e=s[0].groups.filter(e=>e.groupName===i||o("statistics",e.groupName)===i);if(e.length>0){const t=JSON.parse(JSON.stringify(s[0]));return t.groups=e,{statistics:[t]}}}return{statistics:s}}catch(e){return{statistics:[]}}}}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.StatisticsModules=window.LiveScoreApp.Components.StatisticsModules||{},window.LiveScoreApp.Components.Statistics=function(){const e=window.LiveScoreApp.Utils.Cache,t=window.LiveScoreApp.Config,n=window.LiveScoreApp.Utils.jQuery;let i,a,o,s,r=!1,c=null,l=null,d=null,p=!1,u={inProgress:!1,lastUpdate:null};function m(){let e=[];return window.LiveScoreApp.Components.StatisticsModules.Data||e.push("Data"),window.LiveScoreApp.Components.StatisticsModules.UI||e.push("UI"),window.LiveScoreApp.Components.StatisticsModules.Events||e.push("Events"),window.LiveScoreApp.Components.StatisticsModules.Utils||e.push("Utils"),e}function h(t){const n=["ALL","1ST","2ND"];for(const i of n){const n=e.CACHE_PREFIX.STATISTIC+t+"_"+i;e.deleteCacheItem(n)}const i=e.CACHE_PREFIX.STATISTIC+t;return e.deleteCacheItem(i),!0}function w(){const e=window.LiveScoreApp.Modules.MatchDetails,t=e?e.getCurrentTab():null;return!(!e||"statistics"!==t)}function v(e,n=5e3){const i=t.requestConfig&&t.requestConfig.timeoutDuration||5e3;return new Promise(t=>{const a=document.createElement("script");a.src=e,a.async=!1;let o=setTimeout(()=>{t&&t(!1),t=null},n||i);a.onload=()=>{clearTimeout(o),t&&t(!0)},a.onerror=e=>{clearTimeout(o),t&&t(!1)},document.head.appendChild(a)})}function f(){return new Promise(e=>{if(r)return e(!0);const n=window.location.origin+"/wp-content/plugins/v7/js/components/statistics/",c=(new Date).getTime();let l=m();if(0===l.length)return i=window.LiveScoreApp.Components.StatisticsModules.Data,a=window.LiveScoreApp.Components.StatisticsModules.UI,o=window.LiveScoreApp.Components.StatisticsModules.Events,s=window.LiveScoreApp.Components.StatisticsModules.Utils,r=!0,e(!0);const d=[{name:"statistics-data.js",ref:"Data"},{name:"statistics-ui.js",ref:"UI"},{name:"statistics-events.js",ref:"Events"},{name:"statistics-utils.js",ref:"Utils"}].filter(e=>l.includes(e.ref));if(0===d.length)return r=!0,e(!0);const p=d.map(e=>new Promise(i=>{const a=`${n}${e.name}?ver=${c}`,o=t.requestConfig&&t.requestConfig.timeoutDuration||7e3;v(a,o).then(t=>{t?i(!0):v(`/wp-content/plugins/v7/js/components/statistics/${e.name}?ver=${c}`,Math.floor(.7*o)).then(e=>{i(e)})})}));Promise.all(p).then(t=>{i=window.LiveScoreApp.Components.StatisticsModules.Data||null,a=window.LiveScoreApp.Components.StatisticsModules.UI||null,o=window.LiveScoreApp.Components.StatisticsModules.Events||null,s=window.LiveScoreApp.Components.StatisticsModules.Utils||null,t.every(e=>!0===e);const n=t.some(e=>!0===e);r=n||!!(i&&a&&o&&s),e(r)}).catch(t=>{e(!1)})})}function y(e){if(l===e)return p;const t=n.$('.live-scores-match[data-match-id="'+e+'"]');if(!t.length){try{const t=window.LiveScoreApp&&window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails;if(t&&(t.currentMatchId||window.LiveScoreApp.LiveScores?.getSelectedMatchId?.())===e)return p}catch(e){}return!1}return"finished"===t.data("status")}async function g(t){if(S(),y(t))return;const n=e.getFromCacheByType(t,e.CACHE_PREFIX.STATISTIC);if(n&&!0===n.noData){const n=e.CACHE_PREFIX.STATISTIC+t;e.deleteCacheItem(n)}const i=29e3;let a=i;const o=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(o){const e=o.effectiveType||o.type;"4g"===e||"wifi"===e?a=i:"3g"===e?a=Math.max(9e4,i):"2g"!==e&&"slow-2g"!==e||(a=Math.max(12e4,i))}if((navigator.getBattery||navigator.battery&&navigator.battery.level)&&(async()=>{try{const e=await(navigator.getBattery?.())||navigator.battery;e&&e.level<.2&&(a=Math.max(a,45e3))}catch(e){}})().catch(()=>{}),r&&w())try{await A(t)}catch(e){}c=setInterval(async function(){if("hidden"!==document.visibilityState&&w())if(y(t))S();else if(!u.inProgress)try{if(!r&&!await f())return;await A(t)}catch(e){}},a)}function S(){c&&(clearInterval(c),c=null),i&&"function"==typeof i.cancelActiveRequest&&i.cancelActiveRequest()}async function A(t){if(u.inProgress)return!1;u.inProgress=!0;try{if(h(t),!w())return u.inProgress=!1,!1;if(!i||"function"!=typeof i.fetchStatisticsSilently)return u.inProgress=!1,!1;const o=await i.fetchStatisticsSilently(t,p,"ALL");if(o&&!0===o.noData)return u.lastUpdate=Date.now(),u.inProgress=!1,!0;if(o&&o.statistics&&o.statistics.length>0){const n=p?"finished":"live",i=window.LiveScoreApp.Constants.getCacheTTL("STATISTICS",n);e.setToCacheByType(`${t}_1ST`,o,i,e.CACHE_PREFIX.STATISTIC),e.setToCacheByType(`${t}_2ND`,o,i,e.CACHE_PREFIX.STATISTIC)}if(n.$(".statistics-tab").show(),"string"==typeof o&&0===o.indexOf("<"))return h(t),u.inProgress=!1,!1;if(!a||"function"!=typeof a.silentUpdateContent)return u.inProgress=!1,!1;const s=await a.silentUpdateContent(o);return u.lastUpdate=Date.now(),u.inProgress=!1,s}catch(e){return u.inProgress=!1,!1}}return{fetchStatistics:async function(e,t){try{if(await f()&&i)return await i.fetchStatistics(e,t,!0,"ALL");throw new Error('\n                    <div class="statistics-warning">\n                        <h4>İstatistik verileri yüklenemedi</h4>\n                        <p>Gerekli modüller yüklenemedi. Lütfen sayfayı yenileyip tekrar deneyin.</p>\n                    </div>\n                ')}catch(e){throw e}},updateStatisticsTab:async function c(u,v){try{if(!1===v){const e=n.$('.live-scores-match[data-match-id="'+u+'"]');if("notstarted"===(e.length>0?e.data("status"):null))return}if(d&&d.abort(),d=new AbortController,l&&l!==u&&h(l),window.LiveScoreApp.Modules.MatchDetails,S(),l=u,null==v){const e=n.$('.live-scores-match[data-match-id="'+u+'"]');p=e.length>0&&"finished"===e.data("status")}else p=v;let y=null,A=!1;if(!w())return void S();const L=["ALL","1ST","2ND"];for(const t of L){const n=u+"_"+t,i=e.getFromCacheByType(n,e.CACHE_PREFIX.STATISTIC);if(i&&!0!==i.noData){y=i;break}}if(y){const e=a&&"function"==typeof a.renderContent,t=o&&"function"==typeof o.initializeEvents;if(e&&t){let e=!1;if("string"==typeof y)n.$("#tab-statistics").html(y),e=!0;else try{a.renderContent(y),o.initializeEvents(y),e=!0}catch(t){e=!1}if(e){if(p)return;return void g(u)}y=null}else y=null}n.$("#tab-statistics").empty(),A=!1;const b=[100,250,500];for(let e=0;e<b.length&&(A=await f(),!A)&&e!==b.length-1;e++){const t=b[e];await new Promise(e=>setTimeout(e,t))}if(A){if(!w())return void S();y=null;for(const t of L){const n=u+"_"+t,i=e.getFromCacheByType(n,e.CACHE_PREFIX.STATISTIC);if(i&&!0!==i.noData){y=i;break}}if(y){try{"string"==typeof y?n.$("#tab-statistics").html(y):a&&"function"==typeof a.renderContent&&o&&"function"==typeof o.initializeEvents?(a.renderContent(y),o.initializeEvents(y)):n.$("#tab-statistics").html(`<pre>${JSON.stringify(y,null,2)}</pre>`)}catch(e){}if(p)return;return void g(u)}try{if(l!==u)return;if(!w())return void S();let t=null;for(let n=0;n<3;n++){const n=u+"_ALL",i=e.getFromCacheByType(n,e.CACHE_PREFIX.STATISTIC);if(i&&!0!==i.noData&&i.statistics&&i.statistics.length>0){t=i;break}await new Promise(e=>setTimeout(e,300))}if(t){if(l!==u||!w())return;try{a.renderContent(t),o.initializeEvents(t)}catch(e){}return void(p||g(u))}const s=await i.fetchStatistics(u,v,!0,"ALL");if(s&&s.statistics&&s.statistics.length>0){const t=v?"finished":"live",n=window.LiveScoreApp.Constants.getCacheTTL("STATISTICS",t);e.setToCacheByType(`${u}_1ST`,s,n,e.CACHE_PREFIX.STATISTIC),e.setToCacheByType(`${u}_2ND`,s,n,e.CACHE_PREFIX.STATISTIC)}const r=["1ST","2ND"].map(e=>i.fetchStatistics(u,v,!1,e).catch(()=>null));if(l!==u)return;if(Promise.allSettled(r).catch(()=>{}),s&&!0===s.noData)return void(w()&&n.$("#tab-statistics").html('<div style="text-align:center;padding:40px 20px;color:#888;"><p>Bu maç için istatistik verisi bulunmuyor.</p></div>'));if(l!==u)return;if("string"==typeof s)n.$("#tab-statistics").html(s);else if(a&&"function"==typeof a.renderContent&&o&&"function"==typeof o.initializeEvents)try{a.renderContent(s),o.initializeEvents(s)}catch(e){}else n.$("#tab-statistics").html(`<pre>${JSON.stringify(s,null,2)}</pre>`);g(u)}catch(e){const s=window.LiveScoreApp.Components.Skeleton&&window.LiveScoreApp.Components.Skeleton.getSkeleton("statistics")||'<div class="loading-spinner"></div>',r=15*(t.requestConfig.retryDelay||200);if(e&&e.isTimeout)return n.$("#tab-statistics").html(s),void setTimeout(()=>{w()&&(h(u),i&&"function"==typeof i.fetchStatistics?i.fetchStatistics(u,p).then(e=>{e?"string"==typeof e?n.$("#tab-statistics").html(e):a&&"function"==typeof a.renderContent&&o&&"function"==typeof o.initializeEvents?(a.renderContent(e),o.initializeEvents(e)):n.$("#tab-statistics").html(`<pre>${JSON.stringify(e,null,2)}</pre>`):a.showErrorState("Sunucudan yanıt alınamadı. İnternet bağlantınızı kontrol edin ve tekrar deneyin.")}).catch(()=>{a.showErrorState("Sunucudan yanıt alınamadı. İnternet bağlantınızı kontrol edin ve tekrar deneyin.")}):a.showErrorState("Sunucudan yanıt alınamadı. İnternet bağlantınızı kontrol edin ve tekrar deneyin."))},r);if(e&&204===e.status)return void(w()&&n.$("#tab-statistics").html('<div style="text-align:center;padding:40px 20px;color:#888;"><p>Bu maç için istatistik verisi bulunmuyor.</p></div>'));n.$("#tab-statistics").html(s),setTimeout(()=>{w()&&(h(u),i&&"function"==typeof i.fetchStatistics&&i.fetchStatistics(u,p).then(e=>{e?"string"==typeof e?n.$("#tab-statistics").html(e):a&&"function"==typeof a.renderContent&&o&&"function"==typeof o.initializeEvents?(a.renderContent(e),o.initializeEvents(e)):n.$("#tab-statistics").html(`<pre>${JSON.stringify(e,null,2)}</pre>`):a.showErrorState()}).catch(e=>{a.showErrorState()}))},r)}}else{n.$("#tab-statistics").html('\n                <div class="statistics-error-message" style="padding: 15px; border: 1px solid #f5c6cb; border-radius: 6px; background-color: #f8d7da; color: #721c24; margin: 10px 0;">\n                    <h4 style="margin-top: 0;">İstatistik Modülleri Yüklenemedi</h4>\n                    <p>İstatistik verilerini göstermek için gerekli dosyalar yüklenemedi. Lütfen:</p>\n                    <ol>\n                        <li>Sayfayı yenileyin ve tekrar deneyin</li>\n                        <li>Tarayıcı önbelleğini temizleyin</li>\n                        <li>Farklı bir tarayıcı kullanmayı deneyin</li>\n                    </ol>\n                    <button onclick="window.refreshStatisticsTabNow()" style="background-color: #007bff; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer;">Yeniden Dene</button>\n                </div>\n                ');const e=window.LiveScoreApp.Components.StatisticsModules;if(e){let l=m();const d=!(!e.Data||!e.UI);if((0===l.length||d)&&(e.Data&&(i=e.Data),e.UI&&(a=e.UI),e.Events&&(o=e.Events),e.Utils&&(s=e.Utils),d)){r=!0,l.length>0&&(o||(o={initializeEvents:function(){try{return n.$(".statistics-period-selection button").off("click").on("click",function(){n.$(".statistics-period-selection button").removeClass("active"),n.$(this).addClass("active")}),!0}catch(e){return!1}}},window.LiveScoreApp.Components.StatisticsModules.Events=o),s||(s={isValidStatisticsData:function(e){return!!e&&!!e.statistics&&Array.isArray(e.statistics)}},window.LiveScoreApp.Components.StatisticsModules.Utils=s));const e=window.LiveScoreApp.Components.Skeleton&&window.LiveScoreApp.Components.Skeleton.getSkeleton("statistics")||'<div class="loading-spinner"></div>';n.$("#tab-statistics").html(e);const i=t.requestConfig&&t.requestConfig.delay||500;return setTimeout(()=>c(u),i),!0}}}}catch(e){}},loadModules:f,startAutoUpdate:g,stopAutoUpdate:S,performSilentUpdate:A}}(),window.refreshStatisticsTabNow=async function(e){try{if(!e&&window.LiveScoreApp.Modules.MatchDetails){const t=window.LiveScoreApp.Utils.jQuery.$("#match-details").data("match-id");t&&(e=t)}if(!e)return"Güncelleme yapılamadı: Geçerli maç ID'si bulunamadı";const t=window.LiveScoreApp.Components.Statistics;if(t){t.stopAutoUpdate();const n=window.LiveScoreApp.Utils.Cache;if(n){const t=["ALL","1ST","2ND"];for(const i of t)n.deleteCacheItem(n.CACHE_PREFIX.STATISTIC+e+"_"+i);n.deleteCacheItem(n.CACHE_PREFIX.STATISTIC+e)}await t.startAutoUpdate(e);const i=await t.performSilentUpdate(e);return i?`Statistics tabı güncellendi: MatchID: ${e}`:"Statistics tabı güncelleme denendi, sonuç: "+(i?"Başarılı":"Başarısız")}return"Güncelleme yapılamadı: Statistics modülü bulunamadı"}catch(e){return`Güncelleme sırasında hata: ${e.message}`}},window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.H2H=function(){const e=window.LiveScoreApp.Utils.Cache,t=window.LiveScoreApp.Config,n=window.LiveScoreApp.Modules.ScoreUpdater,i=window.LiveScoreApp.Utils.jQuery,a=window.LiveScoreApp.Utils.Translator,o=window.LiveScoreApp.Components&&window.LiveScoreApp.Components.Skeleton;function s(e,t){return"undefined"!=typeof QueuedAjax&&QueuedAjax?QueuedAjax.request(e,t).then(r):i.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:Object.assign({action:e,nonce:window.liveScoresNonce||""},t)}).then(r)}function r(e){return e&&void 0!==e.success&&e.data?e.data:e}let c=null,l=null,d=null,p=null,u=null,m={};function h(){return!c&&window.LiveScoreApp.Utils.MemcachedSync&&(c=window.LiveScoreApp.Utils.MemcachedSync),c}function w(){return!l&&window.LiveScoreApp.Utils.Compression&&(l=window.LiveScoreApp.Utils.Compression),l}function v(){return!d&&window.LiveScoreApp.Utils.SkeletonLoader&&(d=window.LiveScoreApp.Utils.SkeletonLoader),d}const f=e.CACHE_PREFIX.H2H;function y(e,t="all",n=null){if(!Array.isArray(e)||0===e.length)return{homeWins:0,awayWins:0,draws:0,total:0};let i=n;if(!i&&e[0]&&e[0].homeTeam&&(i=e[0].homeTeam.id),!i)return{homeWins:0,awayWins:0,draws:0,total:0};const a=e.filter(e=>function(e){const t=e.homeScore&&void 0!==e.homeScore.display?e.homeScore.display:null,n=e.awayScore&&void 0!==e.awayScore.display?e.awayScore.display:null;if(null===t||null===n)return!1;if("-"===t||"-"===n||"ERT."===t||"ERT."===n||"İPT."===t||"İPT."===n)return!1;const i=parseInt(t),a=parseInt(n);return!isNaN(i)&&!isNaN(a)&&(!e.status||!e.status.type||("finished"===e.status.type||100===e.status.code||e.status.description&&("Ended"===e.status.description||e.status.description.includes("Ended")),!0))}(e)).filter(e=>{if("all"===t)return!0;const n=e.homeTeam?e.homeTeam.id:null,a=e.awayTeam?e.awayTeam.id:null;return"home"===t?n===i:"away"===t&&a===i});window.LiveScoreApp.debugMode;const o=a.reduce((e,t)=>{const n=t.homeTeam?t.homeTeam.id:null,a=t.awayTeam?t.awayTeam.id:null,o=parseInt(t.homeScore.display),s=parseInt(t.awayScore.display);let r;if(n===i)r=o>s?"homeWins":o<s?"awayWins":"draws";else{if(a!==i)return e;r=s>o?"awayWins":s<o?"homeWins":"draws"}return e[r]++,e.total++,e},{homeWins:0,awayWins:0,draws:0,total:0});return window.LiveScoreApp.debugMode,o}function g(t,a){if(!i.$("#history-content").length)return;const s=t,r=e.getFromCacheByType(s,f);if(r)if(window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.Translator&&"function"==typeof window.LiveScoreApp.Utils.Translator.truncateText)try{return void C(r)}catch(t){return e.clearCacheByType(f),void i.$("#history-content").html("<p>H2H verisi yeniden yükleniyor...</p>")}else window.LiveScoreApp.debugMode;const c=v();c?c.showH2HSkeleton():o&&"function"==typeof o.getH2HSkeleton?i.$("#history-content").html(o.getH2HSkeleton()):i.$("#history-content").html('<div class="loading-spinner"></div>');const l=i.$('.live-scores-match[data-match-id="'+t+'"]');if(!l.length)return void i.$("#history-content").html("<p>Maç bilgisi bulunamadı.</p>");const d=function(e){try{if(n&&"function"==typeof n.getMatchData)return n.getMatchData(e)}catch(e){}return e.length?{homeTeamName:e.find(".live-scores-team.home .live-scores-name").text().trim(),awayTeamName:e.find(".live-scores-team.away .live-scores-name").text().trim(),homeTeamLogo:e.find(".live-scores-team.home .team-logo").attr("src"),awayTeamLogo:e.find(".live-scores-team.away .team-logo").attr("src"),homeTeamId:e.data("home-team-id"),awayTeamId:e.data("away-team-id")}:null}(l);if(!d)return void i.$("#history-content").html("<p>Maç verisi alınamadı.</p>");const p=window.LiveScoreApp.currentMatchDetailsData?.[t];if(p&&p.customId){const e=p.customId;return m[t]=e,void L(e,d,t)}("undefined"!=typeof QueuedAjax&&QueuedAjax?QueuedAjax.request("get_match_details",{match_id:t}):i.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:{action:"get_match_details",match_id:t,nonce:window.liveScoresNonce||""}})).then(function(e){if(!e.success)return void S(t,d);const n=e.data&&e.data.customId;n?(m[t]=n,L(n,d,t)):S(t,d)}).catch(function(e){S(t,d)})}function S(e,t){const n=v();n?n.showH2HSkeleton():i.$("#history-content").html('<div class="loading-spinner"></div>'),i.ajax({url:LiveScoresAjax.proxy_url,method:"GET",data:{action:"match_details",match_id:e},success:function(n){let i=n;if("string"==typeof n)try{i=JSON.parse(n)}catch(e){return void A("Veri işleme hatası.")}const a=i&&i.event&&i.event.customId;a?L(a,t,e):A("H2H verisi bu maç için mevcut değildir.")},error:function(e,t,n){A("H2H verisi yüklenemedi. Lütfen daha sonra tekrar deneyin.")}})}function A(e){i.$("#history-content").html('<p style="color: #ff6b6b; padding: 10px; text-align: center;">'+esc_html(e)+"</p>")}function L(n,a,o){n?s("get_h2h_data",{custom_id:n}).then(function(s){if(s&&s.events&&Array.isArray(s.events)){const i=w();let r=s;i&&"function"==typeof i.optimizeResponse&&(r=i.optimizeResponse(s,"h2h")),JSON.stringify(r).length/1024>500&&t.optimizationSettings.compressLargeData&&(r.events=b(r.events));const c={events:r.events,homeTeamLogo:a.homeTeamLogo||"https://cdn.sporkolik.net/teams/default.png",awayTeamLogo:a.awayTeamLogo||"https://cdn.sporkolik.net/teams/default.png",homeTeamName:a.homeTeamName,awayTeamName:a.awayTeamName,referenceTeamId:a.homeTeamId},l=window.LiveScoreApp.Constants.getCacheTTL("H2H","live");e.setToCacheByType(o,c,l,f);const d=h();if(d&&"function"==typeof d.scheduleSyncWithServer)try{const e={type:"h2h_data",key:n,size:JSON.stringify(c).length/1024,timestamp:Date.now(),cacheType:f,dataCount:c.events?c.events.length:0};setTimeout(()=>{d.scheduleSyncWithServer(e)},0)}catch(e){}C(c)}else i.$("#history-content").html("<p>H2H verisi mevcut değil.</p>")}).catch(function(e){var t=e&&e.message||"Unknown error";i.$("#history-content").html("<p>H2H verisi alınamadı. Lütfen daha sonra tekrar deneyin.</p>");const a=h();if(a&&"function"==typeof a.scheduleSyncWithServer)try{const e={type:"h2h_error",key:n,error:t,timestamp:Date.now()};setTimeout(()=>{a.scheduleSyncWithServer(e)},0)}catch(e){}}):i.$("#history-content").html("<p>H2H verisi alınamadı (customId eksik).</p>")}function b(e){let t=e.sort((e,t)=>(t.startTimestamp||0)-(e.startTimestamp||0));return t.length>20&&(t=t.slice(0,20)),t.map(e=>({startTimestamp:e.startTimestamp,status:e.status,tournament:{name:e.tournament?e.tournament.name:"Bilinmiyor"},homeTeam:{id:e.homeTeam?e.homeTeam.id:null,name:e.homeTeam?e.homeTeam.name:"Bilinmiyor",shortName:e.homeTeam?e.homeTeam.shortName:null},awayTeam:{id:e.awayTeam?e.awayTeam.id:null,name:e.awayTeam?e.awayTeam.name:"Bilinmiyor",shortName:e.awayTeam?e.awayTeam.shortName:null},homeScore:e.homeScore,awayScore:e.awayScore,homeRedCards:e.homeRedCards||0,awayRedCards:e.awayRedCards||0}))}function C(e){try{window.currentH2HData=e.events,window.currentH2HReferenceTeamId=e.referenceTeamId,i.$("#history-content").html(M(e.events,e.homeTeamLogo,e.awayTeamLogo,e.referenceTeamId)),x(),T("all")}catch(e){i.$("#history-content").html('<p class="error-message">H2H verileri gösterilirken hata oluştu.</p>')}}function x(){i.$(".h2h-filter-button").off("click").on("click",function(){const e=i.$(this).data("filter");i.$(".h2h-filter-button").removeClass("active"),i.$(this).addClass("active"),"all"===e?i.$(".h2h-match-card").show():(i.$(".h2h-match-card").hide(),i.$(`.h2h-match-card[data-match-type="${e}"]`).show()),T(e)})}function T(e){const t=i.$(".h2h-match-card:visible").filter(function(){const e=i.$(this);return!(e.hasClass("live-match")||e.find(".blinking-quote").length>0||"inprogress"===e.data("status")||"notstarted"===e.data("status"))&&(e.hasClass("finished-match")||"finished"===e.data("status")||"unknown"===e.data("status"))}),n=t.length;let a=null,o=null;t.each(function(){const e=i.$(this).find(".time").text();if(e&&"Tarih bilinmiyor"!==e)try{const t=e.split(".");if(3===t.length){const e=parseInt(t[2]);isNaN(e)||((null===a||e<a)&&(a=e),(null===o||e>o)&&(o=e))}}catch(e){}});let s=`Geçmiş Karşılaşmalar (${n})`;null!==a&&null!==o&&(s+=` (${a} - ${o})`),"home"===e?s+=" - İç Saha":"away"===e&&(s+=" - Deplasman"),i.$(".h2h-summary-title").text(s),k()}function k(){const e=i.$(".h2h-filter-button.active").data("filter")||"all";if(!window.currentH2HData)return;const t=y(window.currentH2HData,e,window.currentH2HReferenceTeamId),n=t.total>0?t.homeWins/t.total*100:0,a=t.total>0?t.draws/t.total*100:0,o=t.total>0?t.awayWins/t.total*100:0;i.$(".match-history-segment.home-wins").css("width",n+"%").attr("title","Ev Sahibi Galibiyet: "+t.homeWins).text(n>=10?t.homeWins:""),i.$(".match-history-segment.draws").css("width",a+"%").attr("title","Beraberlik: "+t.draws).text(a>=10?t.draws:""),i.$(".match-history-segment.away-wins").css("width",o+"%").attr("title","Deplasman Galibiyet: "+t.awayWins).text(o>=10?t.awayWins:""),i.$(".legend-item:eq(0)").html(`<span class="match-history-color home-wins"></span>Ev Sahibi (${t.homeWins})`),i.$(".legend-item:eq(1)").html(`<span class="match-history-color draws"></span>Beraberlik (${t.draws})`),i.$(".legend-item:eq(2)").html(`<span class="match-history-color away-wins"></span>Deplasman (${t.awayWins})`)}function M(e,t,n,i){let o='<div class="h2h-content">';if(!Array.isArray(e)||0===e.length)return o+"<p>Geçmiş maç verisi bulunamadı.</p></div>";t=t||"https://cdn.sporkolik.net/teams/default.png",n=n||"https://cdn.sporkolik.net/teams/default.png";const s=i||(e[0]&&e[0].homeTeam?e[0].homeTeam.id:null),r=y(e,"all",s),c=r.total>0?r.homeWins/r.total*100:0,l=r.total>0?r.draws/r.total*100:0,d=r.total>0?r.awayWins/r.total*100:0;o+='<div class="h2h-summary">';let p=null,u=null;e.forEach(e=>{if(e.startTimestamp){const t=new Date(1e3*e.startTimestamp).getFullYear();(null===p||t<p)&&(p=t),(null===u||t>u)&&(u=t)}});const m=p&&u?` (${p} - ${u})`:"";return o+=`<div class="h2h-summary-title">Geçmiş Karşılaşmalar (${e.length})${m}</div>`,o+=`\n            <div class="match-history-stats">\n                <div class="match-history-stats-bar">\n                    <div class="match-history-segment home-wins" style="width: ${c}%;" title="Ev Sahibi Galibiyet: ${r.homeWins}">${c>=10?r.homeWins:""}</div>\n                    <div class="match-history-segment draws" style="width: ${l}%;" title="Beraberlik: ${r.draws}">${l>=10?r.draws:""}</div>\n                    <div class="match-history-segment away-wins" style="width: ${d}%;" title="Deplasman Galibiyet: ${r.awayWins}">${d>=10?r.awayWins:""}</div>\n                </div>\n                <div class="match-history-stats-legend">\n                    <div class="legend-item"><span class="match-history-color home-wins"></span>Ev Sahibi (${r.homeWins})</div>\n                    <div class="legend-item"><span class="match-history-color draws"></span>Beraberlik (${r.draws})</div>\n                    <div class="legend-item"><span class="match-history-color away-wins"></span>Deplasman (${r.awayWins})</div>\n                </div>\n            </div>\n        `,o+='\n            <div class="h2h-filter-buttons">\n                <button class="h2h-filter-button active" data-filter="all">Tümü</button>\n                <button class="h2h-filter-button" data-filter="home">İç Saha</button>\n                <button class="h2h-filter-button" data-filter="away">Deplasman</button>\n            </div>\n        ',o+='<div class="h2h-match-cards-container">',e.forEach(i=>{if(!i||!i.homeTeam||!i.awayTeam)return;let s=null;try{s=i.startTimestamp?new Date(1e3*i.startTimestamp):null}catch(e){s=null}let r=s?s.toLocaleDateString("tr-TR",{day:"2-digit",month:"2-digit",year:"numeric"}):"Tarih bilinmiyor",c="",l="";try{c=a.translateName("teams",i.homeTeam.shortName&&""!==i.homeTeam.shortName.trim()?i.homeTeam.shortName:i.homeTeam.name),l=a.translateName("teams",i.awayTeam.shortName&&""!==i.awayTeam.shortName.trim()?i.awayTeam.shortName:i.awayTeam.name)}catch(e){c=i.homeTeam.name||"Bilinmiyor",l=i.awayTeam.name||"Bilinmiyor"}let d=i.homeScore&&void 0!==i.homeScore.display?i.homeScore.display:null,p=i.awayScore&&void 0!==i.awayScore.display?i.awayScore.display:null,u="";i.homeRedCards>0&&(u=' <i class="fa fa-square h2h-red-card-icon"></i>'.repeat(i.homeRedCards));let m="";i.awayRedCards>0&&(m=' <i class="fa fa-square h2h-red-card-icon"></i>'.repeat(i.awayRedCards));const h=i.homeTeam.id===e[0].homeTeam.id?"home":"away",w=i.status&&("inprogress"===i.status.type||"notstarted"===i.status.type),v=i.status&&"finished"===i.status.type;o+=`\n                <div class="h2h-match-card match-card ${w?"live-match":""} ${v?"finished-match":""}" \n                    data-match-type="${h}" \n                    data-status="${i.status?i.status.type:"unknown"}">\n                    <div class="time-container">\n                        <div class="time">${r}</div>\n                    </div>\n                    <div class="teams">\n                        <div class="team home">\n                            <img src="${t}" class="team-logo" width="20" height="20" alt="${c} logo">\n                            <span class="team-name">${c}</span>\n                            ${u}\n                            <span class="score score-card" style="${null===d?"visibility:hidden":""}">${null!==d?d:""}</span>\n                        </div>\n                        <div class="team away">\n                            <img src="${n}" class="team-logo" width="20" height="20" alt="${l} logo">\n                            <span class="team-name">${l}</span>\n                            ${m}\n                            <span class="score score-card" style="${null===p?"visibility:hidden":""}">${null!==p?p:""}</span>\n                        </div>\n                    </div>\n                </div>\n            `}),o+="</div>",o+="</div>",o}function $(){p&&(clearInterval(p),p=null,window.LiveScoreApp.debugMode)}return{fetchH2HData:g,generateH2HHTML:M,compressH2HData:b,setupFilterButtons:x,updateHeaderWithFilteredMatchInfo:T,updateStatisticsBar:k,setupAutoUpdate:function(t,n){if(n)return void $();$();const a=window.LiveScoreApp.Constants&&window.LiveScoreApp.Constants.getCacheTTL?window.LiveScoreApp.Constants.getCacheTTL("H2H","live"):3e5,o=Math.max(a-1e3,6e4);u=t,p=setInterval(()=>{if("hidden"===document.visibilityState)return;const n=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails;if(!n||"h2h"!==n.getCurrentTab())return;if(0===i.$("#h2h-"+t).length)return void $();const a=`${t}_h2h`,o=e.CACHE_PREFIX.H2H+a;try{e.deleteCacheItem&&e.deleteCacheItem(o);const n=m[t];n?function(t,n){t&&n&&s("get_h2h_data",{custom_id:t}).then(function(t){if(t&&t.events&&Array.isArray(t.events)){renderH2HTable(t,n);const i=`${n}_h2h`,a=e.CACHE_PREFIX.H2H+i;if(e.setCacheItem&&e.getCacheTTL)try{const n=e.getCacheTTL("H2H","live")||3e5;e.setCacheItem(a,JSON.stringify(t),n)}catch(e){}}}).catch(function(e){})}(n,t):g(t)}catch(e){}},o),window.LiveScoreApp.debugMode},stopAutoUpdate:$,getMemcachedSync:h,getCompression:w,getSkeletonLoader:v}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.Streaks=function(){const e=window.LiveScoreApp.Utils.Cache,t=window.LiveScoreApp.Modules.ScoreUpdater,n=window.LiveScoreApp.Utils.Translator,i=(window.LiveScoreApp.Config,window.LiveScoreApp.Utils.jQuery),a=window.LiveScoreApp.Components&&window.LiveScoreApp.Components.Skeleton;let o=null,s=null,r=null,c=null,l=null;function d(){return!o&&window.LiveScoreApp.Utils.MemcachedSync&&(o=window.LiveScoreApp.Utils.MemcachedSync),o}function p(){return!s&&window.LiveScoreApp.Utils.Compression&&(s=window.LiveScoreApp.Utils.Compression),s}function u(){return!r&&window.LiveScoreApp.Utils.SkeletonLoader&&(r=window.LiveScoreApp.Utils.SkeletonLoader),r}function m(e,t){return window.QueuedAjax&&"function"==typeof window.QueuedAjax.request?window.QueuedAjax.request(e,t).then(h):new Promise(function(n,i){jQuery.ajax({url:LiveScoresAjax.ajax_url,method:"POST",data:Object.assign({action:e,nonce:LiveScoresAjax.nonce},t),success:function(e){n(h(e))},error:function(e,t,n){i(new Error(n||t||"AJAX error"))}})})}function h(e){return e&&"object"==typeof e&&e.hasOwnProperty("success")&&void 0!==e.data?e.data:e}function w(t,n){const o=`teamStreaks_${t}`,s=e.getFromCacheByType(o,e.CACHE_PREFIX.H2H);if(s&&window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.Translator&&"function"==typeof window.LiveScoreApp.Utils.Translator.truncateText)try{return void i.$("#history-content").html(v(s,"general",t))}catch(e){}const r=u();r?r.showStreaksSkeleton():a&&"function"==typeof a.getH2HSkeleton?i.$("#history-content").html(a.getH2HSkeleton()):i.$("#history-content").html('<div class="loading-spinner"></div>'),m("get_streaks_data",{match_id:t}).then(function(n){if(n&&n.general){const a=p();let s=n.general;a&&"function"==typeof a.optimizeResponse&&(s=a.optimizeResponse(n.general,"match"));const r=window.LiveScoreApp.Constants.getCacheTTL("STREAKS","live");e.setToCacheByType(o,s,r,e.CACHE_PREFIX.STREAKS);const c=d();if(c&&"function"==typeof c.scheduleSyncWithServer)try{const t={type:"team_streaks_data",key:o,size:JSON.stringify(s).length/1024,timestamp:Date.now(),cacheType:e.CACHE_PREFIX.H2H,dataCount:Array.isArray(s)?s.length:0};setTimeout(()=>{c.scheduleSyncWithServer(t)},0)}catch(e){}i.$("#history-content").html(v(s,"general",t))}else i.$("#history-content").html("<p>Seri verisi mevcut değil.</p>")}).catch(function(e){i.$("#history-content").html("<p>Seri verisi alınamadı. Lütfen daha sonra tekrar deneyin.</p>");const t=d();if(t&&"function"==typeof t.scheduleSyncWithServer)try{const n={type:"team_streaks_error",key:o,error:e&&e.message||"Unknown error",timestamp:Date.now()};setTimeout(()=>{t.scheduleSyncWithServer(n)},0)}catch(e){}})}function v(e,a,o){const s=i.$('.live-scores-match[data-match-id="'+o+'"]'),r=t.getMatchData(s);let c='<div class="streaks-content">';return Array.isArray(e)&&e.length>0?e.forEach(e=>{let t="";"general"===a?t=n.translateName("teams","home"===e.team?r.homeTeamName:r.awayTeamName):"head2head"===a&&(t=n.translateName("teams","both"===e.team?`${r.homeTeamName} & ${r.awayTeamName}`:"home"===e.team?r.homeTeamName:r.awayTeamName));const i=n.translateStreak(e.name);c+=`\n                    <div class="streak-card custom-h2h-match-card match-card">\n                        <div class="team">\n                            <span class="team-name">${t}</span>\n                            <span class="team-streak">${i}</span>\n                            <span class="streak-value">${e.value}</span>\n                        </div>\n                    </div>`}):c+="<p>Seri verisi mevcut değil.</p>",c+="</div>",c}function f(){c&&(clearInterval(c),c=null,window.LiveScoreApp.debugMode)}return{fetchTeamStreaksData:w,fetchH2HStreaksData:function(t,n){const o=`h2hStreaks_${t}`,s=e.getFromCacheByType(o,e.CACHE_PREFIX.H2H);if(s&&window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.Translator&&"function"==typeof window.LiveScoreApp.Utils.Translator.truncateText)try{return void i.$("#history-content").html(v(s,"head2head",t))}catch(e){}const r=u();r?r.showStreaksSkeleton():a&&"function"==typeof a.getH2HSkeleton?i.$("#history-content").html(a.getH2HSkeleton()):i.$("#history-content").html('<div class="loading-spinner"></div>'),m("get_streaks_data",{match_id:t}).then(function(n){if(n&&n.head2head){const a=p();let s=n.head2head;a&&"function"==typeof a.optimizeResponse&&(s=a.optimizeResponse(n.head2head,"match"));const r=window.LiveScoreApp.Constants.getCacheTTL("H2H","live");e.setToCacheByType(o,s,r,e.CACHE_PREFIX.H2H);const c=d();if(c&&"function"==typeof c.scheduleSyncWithServer)try{const t={type:"h2h_streaks_data",key:o,size:JSON.stringify(s).length/1024,timestamp:Date.now(),cacheType:e.CACHE_PREFIX.H2H,dataCount:Array.isArray(s)?s.length:0};setTimeout(()=>{c.scheduleSyncWithServer(t)},0)}catch(e){}i.$("#history-content").html(v(s,"head2head",t))}else i.$("#history-content").html("<p>Seri verisi mevcut değil.</p>")}).catch(function(e){i.$("#history-content").html("<p>Seri verisi alınamadı. Lütfen daha sonra tekrar deneyin.</p>");const t=d();if(t&&"function"==typeof t.scheduleSyncWithServer)try{const n={type:"h2h_streaks_error",key:o,error:e&&e.message||"Network or server error",timestamp:Date.now()};setTimeout(()=>{t.scheduleSyncWithServer(n)},0)}catch(e){}})},generateStreaksHTML:v,setupAutoUpdate:function(t,n){n?f():(f(),l=t,c=setInterval(()=>{if("hidden"===document.visibilityState)return;const n=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MatchDetails;if(!n||"streaks"!==n.getCurrentTab())return;if(0===i.$("#streaks-"+t).length)return void f();const a=`teamStreaks_${t}`,o=e.CACHE_PREFIX.H2H+a;try{e.deleteCacheItem&&e.deleteCacheItem(o),w(t)}catch(e){}},29e3),window.LiveScoreApp.debugMode)},stopAutoUpdate:f,getMemcachedSync:d,getCompression:p,getSkeletonLoader:u}}(),function(e){"use strict";var t={REFRESH_MS:1e4,PX_PER_SEC:70,PX_PER_SEC_MOB:45,_timer:null,_initialized:!1,init:function(){var n=e(".ls-strip-wrap");0!==n.length&&(t.load(n),t._timer=setInterval(function(){t.load(n)},t.REFRESH_MS),document.addEventListener("visibilitychange",function(){"visible"===document.visibilityState&&t.load(n)}))},load:function(n){var i=n.data("ajax")||("undefined"!=typeof lsConfig?lsConfig.ajaxUrl:"/wp-admin/admin-ajax.php");e.ajax({url:i,type:"POST",data:{action:"get_scoreboard_strip"},timeout:8e3,success:function(e){if(e&&e.success&&e.data&&e.data.html){var i=n.find("#ls-strip-track");if(0===(e.data.count||0))return n.hide(),i.empty(),void(t._initialized=!1);n.is(":visible")||n.show(),t._initialized?t.patchData(i,e.data.html):(i.html(e.data.html),t.setupMarquee(i),t._initialized=!0)}},error:function(){t._initialized||n.find(".ls-strip-skeleton").remove()}})},patchData:function(n,i){var a=e(i),o=n.find(".ls-strip-inner"),s=o.children(".ls-strip-item:not([data-clone])"),r={};a.filter(".ls-strip-item").each(function(){var t=e(this).data("match-id");t&&(r[t]=e(this))});var c=!1,l=[];s.each(function(){var t=e(this),n=t.data("match-id");if(n&&r[n]){var i=r[n];["home","away"].forEach(function(e){var n=i.find('.ls-strip-s[data-type="'+e+'"]').text(),a=t.find('.ls-strip-s[data-type="'+e+'"]');a.length&&a.text()!==n&&(a.text(n),c=!0)});var a=i.find(".ls-strip-badge").first(),o=a.text(),s=t.find(".ls-strip-badge");s.first().text()!==o&&(s.text(o),c=!0),["ls-strip-badge--min","ls-strip-badge--fin","ls-strip-badge--time"].forEach(function(e){s.toggleClass(e,a.hasClass(e))});var d=i.hasClass("ls-strip-live");t.toggleClass("ls-strip-live",d),delete r[n]}else n&&l.push(n)}),l.length>0&&(l.forEach(function(e){o.children('.ls-strip-item[data-match-id="'+e+'"]').remove()}),c=!0);var d=Object.keys(r).length>0;if(d||c){o.children("[data-clone]").remove(),d&&e.each(r,function(e,t){o.append(t)}),o.children(".ls-strip-item").clone().attr("data-clone","true").appendTo(o);var p=o[0].scrollWidth/2,u=window.innerWidth<=600?t.PX_PER_SEC_MOB:t.PX_PER_SEC,m=Math.max(p/u,12);o.css("animation-duration",m+"s")}},setupMarquee:function(n){var i=n.children(".ls-strip-item");if(!(i.length<2)){var a=e('<div class="ls-strip-inner"></div>');i.appendTo(a),i.clone().attr("data-clone","true").appendTo(a),n.empty().append(a);var o=a[0].scrollWidth/2,s=window.innerWidth<=600?t.PX_PER_SEC_MOB:t.PX_PER_SEC,r=Math.max(o/s,12);a.css("animation-duration",r+"s"),n.off("mouseenter.strip mouseleave.strip").on("mouseenter.strip",function(){a.css("animation-play-state","paused")}).on("mouseleave.strip",function(){a.css("animation-play-state","running")})}}};e(document).ready(function(){t.init()})}(jQuery),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.Standings=function(){const e=window.LiveScoreApp.Utils.Cache,t=window.LiveScoreApp.Utils.Translator,n=(window.LiveScoreApp.Config,window.LiveScoreApp.Utils.jQuery),i=(window.LiveScoreApp.Utils.RequestQueue,window.LiveScoreApp.Components&&window.LiveScoreApp.Components.Skeleton);function a(e,t){return"undefined"!=typeof QueuedAjax&&QueuedAjax?QueuedAjax.request(e,t).then(o):n.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:Object.assign({action:e,nonce:window.liveScoresNonce||""},t)}).then(o)}function o(e){return e&&void 0!==e.success&&e.data?e.data:e}let s=null;function r(t,i,a,o=204,s=!1,r=!1){window.LiveScoreApp.hasStandingsData=!1,n.$(".standings-tab").hide(),n.$("#tab-standings").empty();const c=`standings_check_${t}_${i}_${a||0}`,l={exists:!1,timestamp:Date.now(),status:o||204};s&&(l.error=!0);const d=r?"finished":"live",p=window.LiveScoreApp.Constants.getCacheTTL("STANDINGS",d),u=s?p/3:p;window.LiveScoreApp.Utils.Compression?window.LiveScoreApp.Utils.Compression.setOptimizedCache(c,l,u,e.CACHE_PREFIX.STANDING):e.setToCacheByType(c,l,u,e.CACHE_PREFIX.STANDING)}function c(e){if(!e||!e.text)return"";const t=e.text.trim();if(!t)return"";const n=t.toLowerCase();return n.includes("champions league")&&!n.includes("qualification")?"promotion-champions":n.includes("champions league")&&n.includes("qualification")?"promotion-champions-qual":n.includes("europa league")||n.includes("uefa europa")?"promotion-europa":n.includes("conference")?"promotion-conference":n.includes("relegation")?"promotion-relegation":n.includes("next group")||n.includes("main round")?"promotion-next-round":"playoffs"===n?"promotion-playoffs":n.includes("qualification playoff")?"promotion-qualification-playoffs":n.includes("qualif")||"qualified"===n?"promotion-qualified":""}function l(t,a,o,s,r){const c=n.$('.live-scores-match[data-match-id="'+t+'"]'),l=c.data("tournament-id"),u=c.data("season-id"),m=c.data("group-id");if(!l||!u)return;const h=`standings_${l}_${u}_${a}${m?"_"+m:""}`,w=e.getFromCacheByType(h,e.CACHE_PREFIX.STANDING);if(w&&window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.Translator&&"function"==typeof window.LiveScoreApp.Utils.Translator.truncateText)try{return void p(w,a,s,r)}catch(e){}i&&"function"==typeof i.getStandingsSkeleton?n.$("#tab-standings").html(i.getStandingsSkeleton()):window.LiveScoreApp.loadSkeletonUI?(n.$("#tab-standings").html('<div class="loading-spinner"></div>'),window.LiveScoreApp.loadSkeletonUI(function(e){e&&"function"==typeof e.getStandingsSkeleton&&n.$("#tab-standings").html(e.getStandingsSkeleton())})):n.$("#tab-standings").html('<div class="loading-spinner"></div>'),d(l,u,m,a,h,o,s,r).catch(()=>{n.$("#tab-standings").html("<p>Puan durumu mevcut değil.</p>")})}function d(t,i,o,s,c,l,d,u){if(!t||!i)return n.$(".standings-tab").hide(),window.LiveScoreApp.hasStandingsData=!1,Promise.resolve();const m=null!==e.getFromCacheByType(c,e.CACHE_PREFIX.STANDING);return a("get_standings_data",{tournament_id:t,season_id:i,type:s,match_status:l?"finished":"inprogress"}).then(function(a){const m=window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null,h=m?n.$('.live-scores-match[data-match-id="'+m+'"]'):null;if(h&&h.length){const e=h.data("tournament-id"),n=h.data("season-id");if(e&&n&&(String(e)!==String(t)||String(n)!==String(i)))return}if(!a||204!==a.status&&!1!==a.hasData&&null!==a.standings)if(a&&a.standings&&Array.isArray(a.standings)&&a.standings.length>0){let m;if(m=o?a.standings.find(e=>e.tournament.id==o):a.standings[0],m&&m.rows&&m.rows.length>0){const t=window.LiveScoreApp.Constants.getCacheTTL("STANDINGS",l?"finished":"live"),i=l?1/0:t;e.setToCacheByType(c,m,i,e.CACHE_PREFIX.STANDING),window.LiveScoreApp.hasStandingsData=!0,n.$(".standings-tab").show(),p(m,s,d,u)}else r(t,i,o,204,!1,l)}else r(t,i,o,204,!1,l);else r(t,i,o,a.status||204,!1,l)}).catch(function(e){m||r(t,i,o,0,!0,l)})}function p(e,i,a,o){try{if(!e||!e.rows||0===e.rows.length)return n.$("#tab-standings").html("<p>Puan durumu bilgisi mevcut değil.</p>"),void n.$(".standings-tab").hide();const s=n.$('.live-scores-match[data-match-id="'+window.LiveScoreApp.LiveScores.getSelectedMatchId()+'"]'),r=(s.data("tournament-id"),s.data("season-id"),s.data("group-id"),window.LiveScoreApp.Utils.DeviceDetect.isMobile());let d=`\n            <div class="standings-period-selection">\n                <button data-type="total" class="${"total"===i?"active":""}">Genel</button>\n                <button data-type="home" class="${"home"===i?"active":""}">İç Saha</button>\n                <button data-type="away" class="${"away"===i?"active":""}">Deplasman</button>\n            </div>\n            <div class="standings-table-container"${r?' style="overflow-x:hidden"':""}>\n            <table class="standings-table"${r?' style="table-layout:fixed;width:100%"':""}>\n                <thead>\n                    <tr>\n                        <th class="position-cell"${r?' style="width:6%"':""}>#</th>\n                        <th class="team-cell"${r?' style="width:50%"':""}>Takım</th>\n                        <th class="matches-cell tooltip"${r?' style="width:10%"':""} data-tooltip="Oynanan Maç Sayısı" title="Oynanan Maç Sayısı">O</th>\n                        ${r?"":'<th class="wins-cell tooltip" data-tooltip="Galibiyet" title="Galibiyet">G</th>'}\n                        ${r?"":'<th class="draws-cell tooltip" data-tooltip="Beraberlik" title="Beraberlik">B</th>'}\n                        ${r?"":'<th class="losses-cell tooltip" data-tooltip="Mağlubiyet" title="Mağlubiyet">M</th>'}\n                        <th class="goals-cell tooltip"${r?' style="width:18%"':""} data-tooltip="Atılan Gol / Yenen Gol" title="Atılan Gol / Yenen Gol">A/Y</th>\n                        <th class="points-cell tooltip"${r?' style="width:16%"':""} data-tooltip="Puan" title="Puan">P</th>\n                    </tr>\n                </thead>\n                <tbody>\n        `;e.rows.forEach(function(e){const n=e.team.id,i=`https://cdn.sporkolik.net/teams/${n}.png`,s=e.team.shortName||e.team.name,l=t.truncateText(s,25),p=t.translateName("teams",l);d+=`\n                <tr class="${n===a||n===o?"highlighted-row":""}">\n                    <td class="position-cell ${c(e.promotion)}" data-label="#">${e.position}</td>\n                    <td class="team-cell" data-label="Takım">\n                        <img src="${i}" alt="${p} logo" class="team-logo" width="20" height="20" onerror="this.onerror=null;this.src='https://cdn.sporkolik.net/teams/default.png';">\n                        ${p}\n                    </td>\n                    <td class="matches-cell" data-label="O">${e.matches}</td>\n                    ${r?"":'<td class="wins-cell" data-label="G">'+e.wins+"</td>"}\n                    ${r?"":'<td class="draws-cell" data-label="B">'+e.draws+"</td>"}\n                    ${r?"":'<td class="losses-cell" data-label="M">'+e.losses+"</td>"}\n                    <td class="goals-cell" data-label="A/Y">${e.scoresFor}:${e.scoresAgainst}</td>\n                    <td class="points-cell" data-label="P">${e.points}</td>\n                </tr>\n            `}),d+="\n                </tbody>\n            </table>\n            </div>\n        ";let p="";const u=e.rows.some(e=>e.promotion&&e.promotion.text),m=[];u&&e.rows.forEach(e=>{if(e.promotion&&e.promotion.text){const t=c(e.promotion);t&&!m.includes(t)&&m.push(t)}}),u&&m.length>0&&(p=function(e){let t='\n                <div class="standings-legend">\n                    <div class="legend-title">Puan Durumu Açıklamaları:</div>\n                    <div class="legend-items">\n            ';const n={"promotion-champions":"Şampiyonlar Ligi","promotion-champions-qual":"Şampiyonlar Ligi Elemesi","promotion-europa":"UEFA Avrupa Ligi Elemesi","promotion-conference":"Konferans Ligi Elemesi","promotion-relegation":"Küme Düşme Hattı","promotion-next-round":"Bir Sonraki Tur","promotion-playoffs":"Play-Off","promotion-qualification-playoffs":"Play-Off Elemesi","promotion-qualified":"Kalifiye"};return e.forEach(e=>{n[e]&&(t+=`\n                        <div class="legend-item">\n                            <span class="legend-color ${e}"></span>\n                            <span class="legend-text">${n[e]}</span>\n                        </div>\n                    `)}),t+="\n                    </div>\n                </div>\n            ",t}(m)),d+=p,n.$("#tab-standings").html(d),n.$(".standings-period-selection button").off("click").on("click",function(){const e=n.$(this).data("type"),t=window.LiveScoreApp.LiveScores.getSelectedMatchId(),i=n.$('.live-scores-match[data-match-id="'+t+'"]');l(t,e,!!i.length&&"finished"===i.data("status"),a,o)}),n.$(".custom-tooltip").remove(),n.$(".tooltip").off("mouseenter mouseleave").on({mouseenter:function(){n.$(".custom-tooltip").remove();const e=n.$(this).data("tooltip");if(e){const t=n.$('<div class="custom-tooltip"></div>');t.text(e),n.$("body").append(t),n.$(document).on("mousemove.tooltip",function(e){t.css({top:e.pageY-t.outerHeight()-15,left:e.pageX-t.outerWidth()/2})});const i=n.$(this).offset(),a=n.$(this).outerWidth();t.css({top:i.top-t.outerHeight()-10,left:i.left+a/2-t.outerWidth()/2})}},mouseleave:function(){n.$(".custom-tooltip").remove(),n.$(document).off("mousemove.tooltip")}})}catch(e){n.$("#tab-standings").html("<p>Puan durumu gösterilirken hata oluştu.</p>"),n.$(".standings-tab").hide()}}function u(){s&&(clearInterval(s),s=null)}return{updateStandingsTab:function(t){const i=n.$('.live-scores-match[data-match-id="'+t+'"]'),o=i.data("tournament-id"),r=i.data("season-id"),c=i.data("group-id"),d="total",p="finished"===i.data("status"),m=i.data("home-team-id"),h=i.data("away-team-id");l(t,d,p,m,h),function(t,n,i,o){["home","away"].forEach(function(s){const r=`standings_${t}_${n}_${s}${i?"_"+i:""}`;e.getFromCacheByType(r,e.CACHE_PREFIX.STANDING)||a("get_standings_data",{tournament_id:t,season_id:n,type:s}).then(function(t){if(t&&t.standings&&Array.isArray(t.standings)&&t.standings.length>0){let n;if(n=i?t.standings.find(function(e){return e.tournament.id==i}):t.standings[0],n&&n.rows&&n.rows.length>0){const t=window.LiveScoreApp.Constants.getCacheTTL("STANDINGS",o?"finished":"live"),i=o?1/0:t;e.setToCacheByType(r,n,i,e.CACHE_PREFIX.STANDING)}}}).catch(function(){})})}(o,r,c,p),u(),p||(s=setInterval(function(){if("hidden"!==document.visibilityState&&"standings"===n.$(".live-scores-tab-btn.active").data("tab")){var i="standings_"+o+"_"+r+"_"+d+(c?"_"+c:""),a=e.CACHE_PREFIX.STANDING+i;e.deleteCacheItem(a),l(t,d,p,m,h)}},3e4))},fetchStandings:l,checkAndFetchStandings:function(t){const i=n.$('.live-scores-match[data-match-id="'+t+'"]'),o=i.data("tournament-id"),s=i.data("season-id"),c=i.data("group-id")||0,l=!!i.length&&"finished"===i.data("status");if(!o||!s)return window.LiveScoreApp.hasStandingsData=!1,void n.$(".standings-tab").hide();const d=`standings_check_${o}_${s}_${c}`,p=e.getFromCacheByType(d,e.CACHE_PREFIX.STANDING);if(p)return window.LiveScoreApp.hasStandingsData=!0===p.exists,void n.$(".standings-tab").toggle(!0===p.exists);if(n.$(".standings-tab").hide(),n.$(".standings-tab").data("checking"))return;n.$(".standings-tab").data("checking",!0);const u=i.length&&i.data("status")||"";a("get_standings_data",{tournament_id:o,season_id:s,type:"total",match_status:u}).then(function(t){if(n.$(".standings-tab").removeData("checking"),t&&(204===t.status||!1===t.hasData||null===t.standings))return void r(o,s,c,t.status||204,!1,l);const i=t&&t.standings&&Array.isArray(t.standings)&&t.standings.length>0&&t.standings[0]&&t.standings[0].rows&&t.standings[0].rows.length>0;window.LiveScoreApp.hasStandingsData=i,n.$(".standings-tab").toggle(i);const a=window.LiveScoreApp.Constants.getCacheTTL("STANDINGS",l?"finished":"live"),p={exists:i,timestamp:Date.now()};window.LiveScoreApp.Utils.Compression?window.LiveScoreApp.Utils.Compression.setOptimizedCache(d,p,a,e.CACHE_PREFIX.STANDING):e.setToCacheByType(d,p,a,e.CACHE_PREFIX.STANDING)}).catch(function(){n.$(".standings-tab").removeData("checking"),r(o,s,c,400,!0,l)})},getTeamPosition:function(t,i,a,o=0){if(!t||!i||!a)return null;const s=`standings_check_${i}_${a}_${o}`,r=e.getFromCacheByType(s,e.CACHE_PREFIX.STANDING);if(!r||!0!==r.exists){const s=n.$('.live-scores-match[data-tournament-id="'+i+'"][data-season-id="'+a+'"]');if(s.length>0){s.data("match-id"),d(i,a,o,"total",`standings_${i}_${a}_total${o?"_"+o:""}`,!0,null,null);const n=e.getFromCacheByType(`standings_${i}_${a}_total${o?"_"+o:""}`,e.CACHE_PREFIX.STANDING);if(n&&n.rows&&n.rows.length>0)for(let e=0;e<n.rows.length;e++)if(n.rows[e].team.id==t)return n.rows[e].position}return null}const c=`standings_${i}_${a}_total${o?"_"+o:""}`,l=e.getFromCacheByType(c,e.CACHE_PREFIX.STANDING);if(!l||!l.rows||!l.rows.length)return null;for(let e=0;e<l.rows.length;e++)if(l.rows[e].team.id==t)return l.rows[e].position;return null},setNoStandingsData:r,stopPolling:u}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Components=window.LiveScoreApp.Components||{},window.LiveScoreApp.Components.History=function(){const e=window.LiveScoreApp.Utils.Cache,t=window.LiveScoreApp.Utils.Translator,n=(window.LiveScoreApp.Config,window.LiveScoreApp.Utils.RequestQueue,window.LiveScoreApp.Modules.ScoreUpdater,window.LiveScoreApp.Utils.jQuery),i=window.LiveScoreApp.Components&&window.LiveScoreApp.Components.Skeleton;let a=null,o=null,s=null;function r(){return!a&&window.LiveScoreApp.Utils.MemcachedSync&&(a=window.LiveScoreApp.Utils.MemcachedSync),a}function c(){return!o&&window.LiveScoreApp.Utils.Compression&&(o=window.LiveScoreApp.Utils.Compression),o}function l(){return!s&&window.LiveScoreApp.Utils.SkeletonLoader&&(s=window.LiveScoreApp.Utils.SkeletonLoader),s}function d(e){return e&&"object"==typeof e&&e.hasOwnProperty("success")&&void 0!==e.data?e.data:e}function p(e){return(t="get_team_performance",i={team_id:e},window.QueuedAjax&&"function"==typeof window.QueuedAjax.request?window.QueuedAjax.request(t,i).then(d):new Promise(function(e,n){jQuery.ajax({url:LiveScoresAjax.ajax_url,method:"POST",data:Object.assign({action:t,nonce:LiveScoresAjax.nonce},i),success:function(t){e(d(t))},error:function(e,t,i){n(new Error(i||t||"AJAX error"))}})})).then(function(e){return e&&e.events?e:n.getJQuery().Deferred().reject("Invalid API response")});var t,i}function u(e,t,i,a){const o=e.events.sort((e,t)=>t.startTimestamp-e.startTimestamp).slice(0,10),s=t.events.sort((e,t)=>t.startTimestamp-e.startTimestamp).slice(0,10);let r=`\n            <div class="performance-filter-buttons">\n                <button class="performance-filter-button active" data-filter="all">Tümü</button>\n                <button class="performance-filter-button" data-filter="home">İç Saha</button>\n                <button class="performance-filter-button" data-filter="away">Deplasman</button>\n            </div>\n            <div class="performance-container">\n                <div class="performance-team home-performance">\n                    ${y(o,i)}\n                </div>\n                <div class="performance-team away-performance">\n                    ${y(s,a)}\n                </div>\n            </div>\n        `;n.$("#history-content").html(r),m(o,s,i,a)}function m(e,t,i,a){n.$(".performance-filter-button").off("click").on("click",function(){const o=n.$(this).data("filter");n.$(".performance-filter-button").removeClass("active"),n.$(this).addClass("active");const s=h(e,o,i),r=h(t,o,a);n.$(".home-performance").html(y(s,i)),n.$(".away-performance").html(y(r,a)),w(s,r,i,a)}),w(e,t,i,a)}function h(e,t,n){return"all"===t?e:e.filter(e=>"home"===t?e.homeTeam.id===n:"away"===t&&e.awayTeam.id===n)}function w(e,t,i,a){const o=v(e,i),s=v(t,a);let r=f(o,0,"home");n.$(".home-performance .team-performance-stats").remove(),n.$(".home-performance").prepend(r);let c=f(s,0,"away");n.$(".away-performance .team-performance-stats").remove(),n.$(".away-performance").prepend(c)}function v(e,t){let n=0,i=0,a=0;return e.forEach(e=>{if(e.status&&"finished"===e.status.type&&void 0!==e.homeScore?.current&&null!==e.homeScore?.current&&void 0!==e.awayScore?.current&&null!==e.awayScore?.current&&"-"!==e.homeScore.current&&"-"!==e.awayScore.current){const o=parseInt(e.homeScore.current),s=parseInt(e.awayScore.current);isNaN(o)||isNaN(s)||(e.homeTeam.id===t?o>s?n++:o<s?a++:i++:e.awayTeam.id===t&&(s>o?n++:s<o?a++:i++))}}),{wins:n,draws:i,losses:a,total:n+i+a}}function f(e,t,n){const i=e.total,a=i>0?e.wins/i*100:0,o=i>0?e.draws/i*100:0,s=i>0?e.losses/i*100:0;return`\n            <div class="team-performance-stats">\n                <div class="team-performance-title">${"home"===n?"Ev Sahibi":"Deplasman"} - Son ${i} Maç: ${e.wins} Galibiyet - ${e.draws} Beraberlik - ${e.losses} Mağlubiyet</div>\n                <div class="match-history-stats-bar">\n                    <div class="match-history-segment wins" style="width: ${a}%;" title="Galibiyet: ${e.wins}">${a>=10?e.wins:""}</div>\n                    <div class="match-history-segment draws" style="width: ${o}%;" title="Beraberlik: ${e.draws}">${o>=10?e.draws:""}</div>\n                    <div class="match-history-segment losses" style="width: ${s}%;" title="Mağlubiyet: ${e.losses}">${s>=10?e.losses:""}</div>\n                </div>\n            </div>\n        `}function y(e,n){let i="";return e&&0!==e.length?(e.forEach(e=>{const a=new Date(1e3*e.startTimestamp).toLocaleDateString(),o=t.translateName("teams",t.truncateText(e.homeTeam.shortName||e.homeTeam.name,25)),s=t.translateName("teams",t.truncateText(e.awayTeam.shortName||e.awayTeam.name,25)),r=`https://cdn.sporkolik.net/teams/${e.homeTeam.id}.png`,c=`https://cdn.sporkolik.net/teams/${e.awayTeam.id}.png`;let l,d;"finished"===e.status.type?(l=void 0!==e.homeScore?.current&&null!==e.homeScore?.current?e.homeScore.current:"Yok",d=void 0!==e.awayScore?.current&&null!==e.awayScore?.current?e.awayScore.current:"Yok"):"postponed"===e.status.type?(l="ERT.",d="ERT."):"canceled"===e.status.type?(l="İPT.",d="İPT."):(l="-",d="-");const p=window.translations.tournaments[e.tournament.name]||t.truncateText(e.tournament.name,30);let u="loss";if(e.status&&"finished"===e.status.type&&void 0!==e.homeScore?.current&&null!==e.homeScore?.current&&void 0!==e.awayScore?.current&&null!==e.awayScore?.current&&"-"!==e.homeScore.current&&"ERT."!==e.awayScore.current&&"İPT."!==e.awayScore.current){const t=parseInt(e.homeScore.current),i=parseInt(e.awayScore.current);isNaN(t)||isNaN(i)||(e.homeTeam.id===n?u=t>i?"win":t<i?"loss":"draw":e.awayTeam.id===n&&(u=i>t?"win":i<t?"loss":"draw"))}i+=`\n                <div class="performance-card ${u}" data-match-type="${e.homeTeam.id===n?"home":"away"}">\n                    <div class="match-date">\n                        <span>${a}</span> \n                        <span class="tournament-name">${p}</span>\n                    </div>\n                    <div class="match-teams">\n                        <div class="team team-score-row">\n                            <img src="${r}" class="team-logo" alt="${o} logo" width="20" height="20" onerror="this.onerror=null;this.src='https://cdn.sporkolik.net/teams/default.png';">\n                            <span class="team-name">${o}</span>\n                            <span class="match-score">${l}</span>\n                        </div>\n                        <div class="team team-score-row">\n                            <img src="${c}" class="team-logo" alt="${s} logo" width="20" height="20" onerror="this.onerror=null;this.src='https://cdn.sporkolik.net/teams/default.png';">\n                            <span class="team-name">${s}</span>\n                            <span class="match-score">${d}</span>\n                        </div>\n                    </div>\n                </div>\n            `}),i||"<p>Performans verisi bulunamadı.</p>"):"<p>Performans verisi bulunamadı.</p>"}return{fetchPerformanceData:function(t){const a=`performance_${t}`,o=e.getFromCacheByType(a,e.CACHE_PREFIX.GENERAL);if(o)return void u(o.homeData,o.awayData,o.homeTeamId,o.awayTeamId);const s=l();s?s.showPerformanceSkeleton():i&&"function"==typeof i.getPerformanceSkeleton?n.$("#history-content").html(i.getPerformanceSkeleton()):n.$("#history-content").html('<div class="loading-spinner"></div>');const d=n.$('.live-scores-match[data-match-id="'+t+'"]'),m=d.data("home-team-id"),h=d.data("away-team-id");m&&h?n.when(p(m),p(h)).done(function(t,n){const i=c();let o=t,s=n;i&&"function"==typeof i.optimizeResponse&&(o=i.optimizeResponse(t,"match"),s=i.optimizeResponse(n,"match"));const l={homeData:o,awayData:s,homeTeamId:m,awayTeamId:h},d=window.LiveScoreApp.Constants.getCacheTTL("STATISTICS","live");e.setToCacheByType(a,l,d,e.CACHE_PREFIX.GENERAL);const p=r();if(p&&"function"==typeof p.scheduleSyncWithServer)try{const t={type:"performance_data",key:a,size:JSON.stringify(l).length/1024,timestamp:Date.now(),cacheType:e.CACHE_PREFIX.GENERAL,dataCount:(o.events?o.events.length:0)+(s.events?s.events.length:0)};setTimeout(()=>{p.scheduleSyncWithServer(t)},0)}catch(e){}u(o,s,m,h)}).fail(function(e){n.$("#history-content").html("<p>Performans verisi alınamadı. Lütfen daha sonra tekrar deneyin.</p>");const t=r();if(t&&"function"==typeof t.scheduleSyncWithServer)try{const n={type:"performance_error",key:a,error:e.statusText||"Unknown error",timestamp:Date.now()};setTimeout(()=>{t.scheduleSyncWithServer(n)},0)}catch(e){}}):n.$("#history-content").html("<p>Takım bilgileri alınamadı.</p>")},renderPerformanceData:u,setupPerformanceFilterButtons:m,updatePerformanceStats:w,filterEventsByType:h,getMemcachedSync:r,getCompression:c,getSkeletonLoader:l}}(),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.loadSkeletonUI=function(e){let t="";const n=document.querySelectorAll("script[src]");for(const e of n){const n=e.getAttribute("src");if(n&&n.includes("/js/")){t=n.substring(0,n.lastIndexOf("/js/")+4);break}}!t&&window.LiveScoreApp&&window.LiveScoreApp.Config&&window.LiveScoreApp.Config.baseUrl?t=window.LiveScoreApp.Config.baseUrl+"/js/":t||(t="/wp-content/plugins/v7/js/");const i=t+"components/";let a=!1;if(document.getElementById("skeleton-styles"))a=!0;else{const e=document.createElement("link");e.rel="stylesheet",e.href=i+"skeleton/skeleton-styles.css",e.id="skeleton-styles",document.head.appendChild(e)}if(window.LiveScoreApp.Components&&window.LiveScoreApp.Components.Skeleton)"function"==typeof e&&e(window.LiveScoreApp.Components.Skeleton);else if(document.getElementById("skeleton-ui-script")){const t=setInterval(function(){window.LiveScoreApp.Components&&window.LiveScoreApp.Components.Skeleton&&(clearInterval(t),"function"==typeof e&&e(window.LiveScoreApp.Components.Skeleton))},50);setTimeout(function(){clearInterval(t),"function"==typeof e&&e(null)},2e3)}else{const t=document.createElement("script");t.src=i+"skeleton/skeleton-ui.js",t.id="skeleton-ui-script",t.onload=function(){setTimeout(function(){"function"==typeof e&&e(window.LiveScoreApp.Components.Skeleton)},a?0:100)},setTimeout(function(){if(!document.getElementById("skeleton-inline-styles-script")){const e=document.createElement("script");e.src=i+"skeleton/skeleton-inline-styles.js",e.id="skeleton-inline-styles-script",document.head.appendChild(e)}},200)}};const pluginBasePath="/wp-content/plugins/v7/js/";function ensureUtilityModulesLoaded(){[{name:"event-utils.js",path:pluginBasePath+"utils/event-utils.js"},{name:"memcached-sync.js",path:pluginBasePath+"utils/memcached-sync.js"},{name:"cache.js",path:pluginBasePath+"utils/cache.js"},{name:"request-queue.js",path:pluginBasePath+"utils/request-queue.js"}].forEach(e=>{let t=!1;"event-utils.js"===e.name?t=window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.EventUtils:"memcached-sync.js"===e.name?t=window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.MemcachedSync:"cache.js"===e.name?t=window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.Cache:"request-queue.js"===e.name&&(t=window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.RequestQueue),t||loadUtilityScript(e.name,e.path)}),setTimeout(function(){[{name:"EventUtils",obj:window.LiveScoreApp?.Utils?.EventUtils},{name:"MemcachedSync",obj:window.LiveScoreApp?.Utils?.MemcachedSync},{name:"Cache",obj:window.LiveScoreApp?.Utils?.Cache},{name:"RequestQueue",obj:window.LiveScoreApp?.Utils?.RequestQueue}].forEach(e=>{e.obj||createUtilityModuleFallback(`${e.name.toLowerCase()}.js`)})},800)}const hasRequestIdGenerator=loadUtilityScript("request-id-generator.js",pluginBasePath+"utils/request-id-generator.js"),hasMemcachedSyncJs=loadUtilityScript("memcached-sync.js",pluginBasePath+"utils/memcached-sync.js"),hasEventUtils=loadUtilityScript("event-utils.js",pluginBasePath+"utils/event-utils.js");function updateMatchScores(e,t){const n=window.pageYOffset;try{const i=e.querySelector(".live-scores-team.home .live-scores-score"),a=t.querySelector(".live-scores-team.home .live-scores-score");if(i&&a&&i.textContent!==a.textContent){const e=parseInt(i.textContent)||0,t=parseInt(a.textContent)||0;i.textContent=a.textContent,t>e&&triggerGoalAnimation(i,"goal")}const o=e.querySelector(".live-scores-team.away .live-scores-score"),s=t.querySelector(".live-scores-team.away .live-scores-score");if(o&&s&&o.textContent!==s.textContent){const e=parseInt(o.textContent)||0,t=parseInt(s.textContent)||0;o.textContent=s.textContent,t>e&&triggerGoalAnimation(o,"goal")}const r=e.querySelector(".live-scores-minute"),c=t.querySelector(".live-scores-minute");if(r&&c){const e=(r.innerHTML||"").trim(),t=(c.innerHTML||"").trim();e!==t&&(r.innerHTML=t)}ScoreUpdater&&"function"==typeof ScoreUpdater.updateMatchStatus&&setTimeout(()=>{try{ScoreUpdater.updateMatchStatus(jQueryUtils.$(e))}catch(e){}},0),Math.abs(window.pageYOffset-n)>5&&window.scrollTo(0,n)}catch(e){}}setTimeout(ensureUtilityModulesLoaded,50),jQuery(document).ready(function(e){if(window.LiveScoreApp&&window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.jQuery&&window.LiveScoreApp.Utils.jQuery.setWpjQuery(e),ensureUtilityModulesLoaded(),!function(){if(!(window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.Cache&&window.LiveScoreApp.Utils.RequestQueue&&window.LiveScoreApp.Utils.Translator&&window.LiveScoreApp.Utils.DomUtils))return window.LiveScoreApp.Utils.Cache||loadUtilityScript("cache.js",pluginBasePath+"utils/cache.js"),window.LiveScoreApp.Utils.RequestQueue||loadUtilityScript("request-queue.js",pluginBasePath+"utils/request-queue.js"),window.LiveScoreApp.Utils.Translator||loadUtilityScript("translator.js",pluginBasePath+"utils/translator.js"),window.LiveScoreApp.Utils.DomUtils||loadUtilityScript("dom-utils.js",pluginBasePath+"utils/dom-utils.js"),!1;if(!window.LiveScoreApp.Modules||!window.LiveScoreApp.Modules.UI||!window.LiveScoreApp.Modules.ScoreUpdater)return!1;if(window.LiveScoreApp.Components||(window.LiveScoreApp.Components={}),!window.LiveScoreApp.Components.Skeleton){const e=pluginBasePath+"components/",t=document.createElement("link");t.rel="stylesheet",t.href=e+"skeleton/skeleton-styles.css",t.id="skeleton-styles",document.head.appendChild(t);const n=document.createElement("script");n.src=e+"skeleton/skeleton-ui.js",n.id="skeleton-ui-script",document.head.appendChild(n),setTimeout(function(){const t=document.createElement("script");t.src=e+"skeleton/skeleton-inline-styles.js",t.id="skeleton-inline-styles-script",document.head.appendChild(t)},200)}if(window.LiveScoreApp.Components){const e=window.LiveScoreApp.Components;if(!e.Lineups){const t=pluginBasePath+"components/",n=document.createElement("script");n.src=t+"lineups.js",document.head.appendChild(n),e.Lineups={fetchLineups:function(e,t,n){const i='\n                            <div class="lineup-warning">\n                                <h4>Kadro verisi geçici olarak kullanılamıyor</h4>\n                                <p>Lineups.js dosyası yüklenemedi. Lütfen tema/eklenti ayarlarını kontrol edin.</p>\n                            </div>\n                        ';return"function"==typeof n&&n(!0,i),i}}}if(!e.Statistics){const t=pluginBasePath+"components/",n=document.createElement("script");n.src=t+"statistics.js",document.head.appendChild(n),e.Statistics={fetchStatistics:function(e,t,n){const i='\n                            <div class="statistics-warning">\n                                <h4>İstatistik verisi geçici olarak kullanılamıyor</h4>\n                                <p>Statistics.js dosyası yüklenemedi. Lütfen tema/eklenti ayarlarını kontrol edin.</p>\n                            </div>\n                        ';return"function"==typeof n&&n(!0,i),i}}}}return!!window.LiveScoreApp.Config&&(window.LiveScoreApp.LiveScores||(window.LiveScoreApp.LiveScores={init:function(){}}),!0)}())return ensureUtilityModulesLoaded(),void setTimeout(function(){try{window.LiveScoreApp&&window.LiveScoreApp.LiveScores&&window.LiveScoreApp.LiveScores.init&&window.LiveScoreApp.LiveScores.init()}catch(e){}},300);try{window.LiveScoreApp.LiveScores.init()}catch(e){}}),window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.ModuleLoader={setupMatchDetailsEventListeners:function(e,t){if(!t||"function"!=typeof t.closeMatchDetails)return;const n=window.LiveScoreApp?.Utils?.EventUtils;if(n&&"function"==typeof n.setupMatchDetailsEventListeners)return n.setupMatchDetailsEventListeners(e,t);try{const n=window.LiveScoreApp?.Utils?.JQueryUtils;n&&(n.$(".live-scores-menu-item").off("click.matchDetails").on("click.matchDetails",function(){const t=n.$(this).data("tab");n.$(".live-scores-menu-item").removeClass("active").attr("aria-selected","false"),n.$(this).addClass("active").attr("aria-selected","true");const i=window.LiveScoreApp?.Modules?.MatchDetailsTabs;i&&"function"==typeof i.updateTabContent&&i.updateTabContent(e,t)}),n.$(".live-scores-back-button").off("click.matchDetails").on("click.matchDetails",function(n){n.preventDefault(),n.stopPropagation(),"function"==typeof t.closeMatchDetails&&t.closeMatchDetails(e)}))}catch(e){}},cleanupMatchDetailsEventListeners:function(){const e=window.LiveScoreApp?.Utils?.EventUtils;if(e&&"function"==typeof e.cleanupMatchDetailsEventListeners)return e.cleanupMatchDetailsEventListeners()}},window.console&&(window.console.log("%c===DIRECT CONSOLE TEST===","color: red; font-size: 14px; font-weight: bold;"),window.console.log("Main.js loaded!")),window.LiveScoreApp||(window.LiveScoreApp={}),window.LiveScoreApp.hasHistoricalDataLoaded=!1,window._matchUpdateQueue=new Map,window._updateDebounceTimers=new Map,window.LiveScoreApp.debouncedUpdate=function(e,t,n=100){window._updateDebounceTimers.has(e)&&clearTimeout(window._updateDebounceTimers.get(e));const i=setTimeout(()=>{t(),window._updateDebounceTimers.delete(e)},n);window._updateDebounceTimers.set(e,i)},window.LiveScoreApp.clearAllPendingUpdates=function(){for(const[e,t]of window._updateDebounceTimers)clearTimeout(t);window._updateDebounceTimers.clear(),window._matchUpdateQueue&&window._matchUpdateQueue.clear()},jQuery(document).ready(function(e){const t=window.LiveScoreApp.Components&&window.LiveScoreApp.Components.Skeleton;window.LiveScoreApp=window.LiveScoreApp||{},window.LiveScoreApp.Utils=window.LiveScoreApp.Utils||{},window.LiveScoreApp.Utils.jQuery?window.LiveScoreApp.Utils.jQuery.setWpjQuery(e):window.LiveScoreApp.Utils.jQuery={$:e,getElement:e,ajax:e.ajax,ready:function(t){e(document).ready(t)},getJQuery:function(){return e},setWpjQuery:function(e){this.$=e}};const n=window.LiveScoreApp.Config,i=window.LiveScoreApp.Utils.Cache,a=window.LiveScoreApp.Utils.RequestQueue,o=window.LiveScoreApp.Modules.UI,s=window.LiveScoreApp.Modules.ScoreUpdater,r=window.LiveScoreApp.Modules.MetaTags,c=window.LiveScoreApp.Modules.MatchDetails,l=window.LiveScoreApp.Modules.SEO,d=window.LiveScoreApp.Utils.jQuery,p=window.LiveScoreApp.Utils.TimerManager;window.LiveScoreApp.LiveMatches=new Map,window.LiveScoreApp.LiveScores=function(){let e=null,u=!1,m=null,h=!0,w=!1,v=null,f={},y=0,g=null,S=!1,A=0,L=!1,b=!1,C=!1;function x(){if(p&&v){const e=window.LiveScoreApp.Constants.getCacheTTL("LIVE_SCORES","live");p.clearInterval("main-score-update"),p.setInterval(v,e,"main-score-update")}}function T(e,t){const n=window.translations&&window.translations.uiMessages;return n&&"string"==typeof n[e]&&""!==n[e].trim()?n[e]:t}function k(){return new Promise((e,t)=>{const n=Date.now();let i=0;for(let[e,t]of window.LiveScoreApp.LiveMatches.entries())(!t.timestamp||n-t.timestamp>3e5)&&(window.LiveScoreApp.LiveMatches.delete(e),i++);if(window.LiveScoreApp.LiveMatches.size>1350){const e=Array.from(window.LiveScoreApp.LiveMatches.entries()).sort((e,t)=>(e[1].timestamp||0)-(t[1].timestamp||0)),t=window.LiveScoreApp.LiveMatches.size-1215;e.slice(0,t).forEach(([e])=>{window.LiveScoreApp.LiveMatches.delete(e),i++})}else if(window.LiveScoreApp.LiveMatches.size>1500){const e=Array.from(window.LiveScoreApp.LiveMatches.entries()).sort((e,t)=>(e[1].timestamp||0)-(t[1].timestamp||0)),t=window.LiveScoreApp.LiveMatches.size-1200;e.slice(0,t).forEach(([e])=>{window.LiveScoreApp.LiveMatches.delete(e),i++})}else window.LiveScoreApp.LiveMatches.size>1100&&(Array.from(window.LiveScoreApp.LiveMatches.entries()).sort((e,t)=>(e[1].timestamp||0)-(t[1].timestamp||0)).slice(0,30).forEach(([e])=>{window.LiveScoreApp.LiveMatches.delete(e),i++}),window.LiveScoreApp.debugMode);if(i>0){const e=window.LiveScoreApp.LiveMatches.size;if(window.LiveScoreApp.debugMode,e>1450){const e=12e4;let t=0;for(let[i,a]of window.LiveScoreApp.LiveMatches.entries())(!a.timestamp||n-a.timestamp>e)&&(window.LiveScoreApp.LiveMatches.delete(i),t++)}}d.ajax({url:LiveScoresAjax.ajax_url,type:"POST",data:{action:"get_live_scores",type:"live",translations:window.translations||{}},dataType:"json",timeout:15e3,complete:function(e,t){e.responseText}}).then(function(t){if(!t||!t.success)return void e();const n=[],i=new Map;if(t.data&&t.data.events&&Array.isArray(t.data.events)){let e=0,a=0;for(const o of t.data.events)if(o&&o.id){const t=o.id.toString(),s=window.LiveScoreApp.LiveMatches.has(t);if(!s&&window.LiveScoreApp.LiveMatches.size>=1500){a++;continue}n.push(t);const r=o.status&&o.status.type?String(o.status.type).toLowerCase():"inprogress";i.set(t,r),o.timestamp=Date.now(),window.LiveScoreApp.LiveMatches.set(t,o),s||e++}e>0||a>0||window.LiveScoreApp.debugMode;const o=t.data.live_count||0;window.LiveScoreApp.lastLiveCount=o,d.$("#live-matches").text("● CANLI ("+o+")"),window.LiveScoreApp.Config&&window.LiveScoreApp.Config.updateDynamicSettings&&window.LiveScoreApp.Config.updateDynamicSettings()}n.length>0&&n.forEach(e=>{const t=d.$(`.live-scores-match[data-match-id="${e}"]`);if(t.length){const n=i.get(e)||"inprogress";t.data("status",n),t.attr("data-status",n);const a=window.LiveScoreApp.LiveMatches.get(e);if(a&&a.status&&a.status.description){const e=a.status.description;t.data("status-description",e),t.attr("data-status-description",e),t.find(".live-scores-minute").attr("data-status-description",e)}if(a&&a.homeScore&&a.awayScore){const e=a.homeScore.display,n=a.awayScore.display;if(void 0!==e&&void 0!==n){const i=t.find(".live-scores-team.home .live-scores-score"),a=t.find(".live-scores-team.away .live-scores-score"),o=i.text(),s=a.text(),r=String(e),c=String(n);o!==r&&i.text(r),s!==c&&a.text(c)}}window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.ScoreUpdater&&window.LiveScoreApp.Modules.ScoreUpdater.updateMatchStatus(t)}}),window.LiveScoreApp.LiveMatches.size,e()}).catch(function(t){e()})})}function M(){const e=window.location.pathname;let t,n,i,a=null;if("/canli-skor"===e||"/canli-skor/"===e)return d.$("#live-matches").addClass("active"),d.$("#all-matches").removeClass("active"),d.$(".date-picker-container").removeClass("visible"),u=!1,m="live",r&&"function"==typeof r.updateMetaTags&&r.updateMetaTags("live",new Date),$(null,null,null,"live"),void(S=!0);const o=e.match(/\/canli-skor\/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})\/?$/i);if(o&&4===o.length)a={day:o[1],month:o[2],year:o[3],format:"path"};else{const e=new URLSearchParams(window.location.search),t=e.get("day"),n=e.get("month"),i=e.get("year");t&&n&&i&&(a={day:t,month:n,year:i,format:"query"})}if(a){t=a.day,n=a.month,i=a.year;const e=parseInt(t),o=parseInt(n),s=parseInt(i);if(!isNaN(e)&&!isNaN(o)&&!isNaN(s)){d.$("#all-matches").addClass("active"),d.$("#live-matches").removeClass("active"),d.$(".switch-menu").removeClass("indicator-right"),d.$(".date-picker-container").addClass("visible"),u=!0;const c=`${e}/${o}/${s}`,l=document.getElementById("date-picker");l&&l._flatpickr?l._flatpickr.setDate(new Date(s,o-1,e),!0):d.$("#date-picker").val(c),m="all";const p=new Date(s,o-1,e);if(isNaN(p.getTime())){const e=new Date;r&&"function"==typeof r.updateMetaTags?r.updateMetaTags("all",e):document.title="Canlı Skor - Maç Programı ve Sonuçları | Sporkolik"}else if(r&&"function"==typeof r.updateMetaTags)try{r.updateMetaTags("all",p)}catch(t){document.title=`Canlı Skor - ${window.LiveScoreApp.formatNaturalDate(e,o,s)} Maç Programı | Sporkolik`}else document.title=`Canlı Skor - ${window.LiveScoreApp.formatNaturalDate(e,o,s)} Maç Programı | Sporkolik`;if($(t,n,i,"all"),S=!0,"query"===a.format){const a=window.location.pathname,r=`${a.endsWith("/")?a.slice(0,-1):a}/canli-skor/${e}/${o}/${s}/`;window.history.replaceState({day:t,month:n,year:i,type:"all"},"",r)}}}}function $(e,n,o,s="live",r=!0){const l=s+"_"+(e||"")+"_"+(n||"")+"_"+(o||"");if(f[l])return f[l];const u=++y;if(g&&"function"==typeof g.abort&&(g.abort(),g=null,Object.keys(f).forEach(function(e){e!==l&&delete f[e]})),e=(e||"").toString().trim(),n=(n||"").toString().trim(),o=(o||"").toString().trim(),!e||!n||!o){const t=new Date;e=t.getDate().toString(),n=(t.getMonth()+1).toString(),o=t.getFullYear().toString()}e=e.padStart(2,"0"),n=n.padStart(2,"0"),i.CACHE_PREFIX.LIVESCORE;const m=`liveScore_${e}_${n}_${o}_${s}`,v=i.getFromCacheByType(m,i.CACHE_PREFIX.LIVESCORE);if(v){if(0!==document.querySelectorAll(".live-scores-match:not(.skeleton-match)").length&&!w&&b||(I(v,s,!b),b=!0,w&&(w=!1)),"live"===s){const e=window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null;e&&c.updateMatchDetailScores(e)}return Promise.resolve(v)}if(h&&r){if(!document.querySelector(".live-scores-match:not(.skeleton-match)"))if(t&&"function"==typeof t.getTournamentSkeleton){const e=t.getTournamentSkeleton(3);d.$("#live-scores").html(e)}else window.LiveScoreApp.loadSkeletonUI?(d.$("#live-scores").html('<div class="loading-spinner"></div>'),window.LiveScoreApp.loadSkeletonUI(function(e){if(e){const t=e.getTournamentSkeleton(3);d.$("#live-scores").html(t)}})):d.$("#live-scores").html('<div class="loading-spinner"></div>');h=!1}const S=("live"===s?a.enqueueHighPriority:a.enqueue)(function(){if(!window.LiveScoresAjax||!window.LiveScoresAjax.ajax_url)return d.$("#live-scores").html("<p>Ajax URL yapılandırma hatası. Lütfen yönetici ile iletişime geçin.</p>"),Promise.reject(new Error("Ajax URL hatası"));const t=d.ajax({url:LiveScoresAjax.ajax_url,type:"POST",data:{action:"get_live_scores",day:e,month:n,year:o,type:s,translations:window.translations||{}},dataType:"json",timeout:15e3,complete:function(e,t){e.responseText}});return g=t,t.then(function(a){if(!a||!a.success){if(document.querySelectorAll(".live-scores-match").length>0)return null;throw new Error("Canlı skorlar alınırken hata oluştu.")}sessionStorage.setItem("liveRetryCount_"+s,"0"),d.$("#live-scores").find(".loading-spinner").remove();let r,l=i.CACHE_PREFIX.LIVESCORE;if("live"===s)r=window.LiveScoreApp.Constants.getCacheTTL("LIVE_SCORES","live"),l=i.CACHE_PREFIX.LIVESCORE;else if("all"===s){const t=new Date,a=t.getFullYear()+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0");r=o+"-"+n+"-"+e===a?window.LiveScoreApp.Constants.CACHE_TTL.HISTORICAL_MATCHES.notstarted||6e5:window.LiveScoreApp.Constants.CACHE_TTL.HISTORICAL_MATCHES.finished||36e5,l=i.CACHE_PREFIX.LIVESCORE}else r=6e4,l=i.CACHE_PREFIX.LIVESCORE;if(g===t&&(g=null),u!==y)return a.data;if(i.setToCacheByType(m,a.data,r,l),I(a.data,s,!C),C=!0,b=!0,a.data.article_phases&&document.dispatchEvent(new CustomEvent("ls:phases-update",{detail:a.data.article_phases})),"live"===s){if(a.data.events&&Array.isArray(a.data.events))for(const e of a.data.events)if(e&&e.id){const t=e.id.toString();if(!window.LiveScoreApp.LiveMatches.has(t)&&window.LiveScoreApp.LiveMatches.size>=500)continue;e.timestamp=Date.now(),window.LiveScoreApp.LiveMatches.set(t,e)}const e=window.LiveScoreApp.LiveScores?window.LiveScoreApp.LiveScores.getSelectedMatchId():null;e&&c.updateMatchDetailScores(e)}return a.data}).catch(function(t){if("abort"===t.statusText||t&&0===t.readyState&&0===t.status&&"abort"===t.statusText)return null;522===t.status||t.responseText&&-1!==t.responseText.indexOf("<!DOCTYPE")||t.statusText||t.responseText&&t.responseText.substring(0,100),t.responseText;var i=document.querySelectorAll(".live-scores-match").length>0,a="liveRetryCount_"+s,c=parseInt(sessionStorage.getItem(a)||"0");if(c<3){var l=Math.min(1e3*Math.pow(2,c),8e3);if(sessionStorage.setItem(a,(c+1).toString()),i);else{var u="all"===s?"<p>"+T("allRetryingSoft","Veriler guncelleniyor, lutfen bekleyin...")+"</p>":"<p>"+T("genericRetrying","Veriler alinirken bir hata olustu. Yeniden deneniyor...")+"</p>";d.$("#live-scores").find(".loading-spinner").remove(),d.$("#live-scores").html(u)}return L=!0,p&&p.clearInterval("main-score-update"),setTimeout(function(){L=!1,$(e,n,o,s,r),x()},l),null}return sessionStorage.setItem(a,"0"),i||(d.$("#live-scores").find(".loading-spinner").remove(),0===t.readyState?"all"===s?d.$("#live-scores").html("<p>"+T("allConnectionIssue","Verilere su an ulasilamiyor. Kisa sure icinde otomatik tekrar denenecek.")+"</p>"):d.$("#live-scores").html("<p>"+T("genericConnectionIssue","Sunucuya baglanamiyoruz. Internet baglantinizi kontrol edin veya daha sonra tekrar deneyin.")+"</p>"):"all"===s?d.$("#live-scores").html("<p>"+T("allTemporaryIssue","Veriler gecici olarak alinmadi. Sistem otomatik olarak yeniden deneyecek.")+"</p>"):d.$("#live-scores").html("<p>"+T("genericTemporaryIssue","Veriler yuklenirken bir hata olustu. Lutfen daha sonra tekrar deneyin.")+"</p>")),L=!1,x(),null})});return f[l]=S,S&&"function"==typeof S.finally?S.finally(function(){delete f[l]}):S&&"function"==typeof S.then?S.then(function(){delete f[l]},function(){delete f[l]}):delete f[l],S}function I(t,n,i){if(d.$("#live-scores").find(".loading-spinner, .skeleton-match, .skeleton-tournament, .skeleton-pulse").remove(),t&&"object"==typeof t&&!Array.isArray(t)){if(t.events&&Array.isArray(t.events)||(t.events=[]),"live"===n){const e=t.live_count||t.events.length||0;window.LiveScoreApp.lastLiveCount=e,d.$("#live-matches").text("● CANLI ("+e+")"),window.LiveScoreApp.Config&&window.LiveScoreApp.Config.updateDynamicSettings&&window.LiveScoreApp.Config.updateDynamicSettings()}if(0===document.querySelectorAll(".live-scores-match").length||w||i)if(t.output&&t.output.trim().length>0)d.$("#live-scores").html(t.output),F(),w&&(w=!1);else if(t.events&&0===t.events.length){const e="live"===n?'<div class="live-scores-no-live-events">Şu an oynanan canlı futbol maçı yok</div>':'<div class="live-scores-no-events">Bu tarih için maç bulunamadı</div>';d.$("#live-scores").html(e),"live"===n&&l.appendSeoText(),w&&(w=!1)}else d.$("#live-scores").html('<div class="live-scores-no-live-events">Veri yüklenirken bir hata oluştu. Lütfen daha sonra tekrar deneyin.</div>'),w&&(w=!1);else t.events&&0===t.events.length&&!t.output||function(t,n){if(!t.output)return;const i=document.createElement("div");i.innerHTML=t.output;const a=i.querySelectorAll(".live-scores-match"),r=i.querySelectorAll(".live-scores-tournament-card"),c=new Map,l=new Map;if(document.querySelectorAll(".live-scores-match").forEach(e=>{const t=e.getAttribute("data-match-id");t&&c.set(t,e)}),document.querySelectorAll(".live-scores-tournament-card").forEach(e=>{const t=e.getAttribute("data-group-id");t&&l.set(t,e)}),0===c.size&&a.length>0)return d.$("#live-scores").html(t.output),F(),void(window.updateLeagueFilterBar&&window.updateLeagueFilterBar());const p=new Set,u=new Map;a.forEach(e=>{const t=e.getAttribute("data-match-id");if(t&&!p.has(t)){p.add(t);const n=e.getAttribute("data-status");n&&u.set(t,n),c.has(t)?window.LiveScoreApp.debouncedUpdate(t,()=>{(async function(e,t){window._matchUpdateQueue||(window._matchUpdateQueue=new Map);const n=e.getAttribute("data-match-id");if(window._matchUpdateQueue.has(n)){const e=window._matchUpdateQueue.get(n);try{await e}catch(e){}}const i=async function(e,t){return new Promise((n,i)=>{let a;try{a={scores:E(e,t),minute:D(e,t),redCards:_(e,t),status:P(e,t),attributes:U(e,t)}}catch(e){return void i(new Error("Data extraction failed: "+e.message))}const o=window.pageYOffset;requestAnimationFrame(()=>{try{let i=!1;if(!document.contains(e))return void n();a.scores.hasChanges&&((t=a.scores).home.element&&t.home.newValue&&(t.home.element.textContent=t.home.newValue,t.home.hasGoal&&R(t.home.element,"goal")),t.away.element&&t.away.newValue&&(t.away.element.textContent=t.away.newValue,t.away.hasGoal&&R(t.away.element,"goal")),i=!0),a.minute.hasChanges&&(function(e,t){if(t.minute&&t.minute.element){t.minute.element.innerHTML=t.minute.newValue;const n=e.getAttribute("data-match-id");n&&s&&s._clearFormattedMinuteCache&&s._clearFormattedMinuteCache(n)}t.time&&t.time.element&&(t.time.element.textContent=t.time.newValue)}(e,a.minute),i=!0),a.redCards.hasChanges&&(function(e,t){t.home.oldValue!==t.home.newValue&&(e.setAttribute("data-home-red-cards",t.home.newValue),N(e,"home",t.home.newValue)),t.away.oldValue!==t.away.newValue&&(e.setAttribute("data-away-red-cards",t.away.newValue),N(e,"away",t.away.newValue))}(e,a.redCards),i=!0),a.status.hasChanges&&(function(e,t){null!==t.status&&e.setAttribute("data-status",t.status),t.description&&e.setAttribute("data-status-description",t.description)}(e,a.status),i=!0),a.attributes.hasChanges&&(function(e,t){t.changes.forEach(t=>{e.setAttribute(t.attribute,t.value)})}(e,a.attributes),i=!0),i&&(Math.abs(window.pageYOffset-o)>5&&window.scrollTo(0,o),setTimeout(()=>{if(s&&"function"==typeof s.updateMatchStatus)try{s.updateMatchStatus(d.$(e))}catch(e){}},0));try{if(!d.$(e).data("events")||!d.$(e).data("events").click){const e=window.LiveScoreApp.Modules.UI||window.LiveScoreApp.Modules.ui;e&&"function"==typeof e.attachMatchClickEvents?e.attachMatchClickEvents():d.$("#live-scores").off("click",".live-scores-match").on("click",".live-scores-match",function(e){e.preventDefault();const t=e.target.closest(".analysis-badge");if(t){const e=t.dataset.href;return void(e&&window.open(e,"_blank","noopener,noreferrer"))}const n=d.$(this).attr("data-match-id");n&&window.LiveScoreApp.Modules.MatchDetails&&"function"==typeof window.LiveScoreApp.Modules.MatchDetails.openMatchDetails&&window.LiveScoreApp.Modules.MatchDetails.openMatchDetails(n)})}}catch(e){}n()}catch(e){i(new Error("Atomic update failed: "+e.message))}var t})})}(e,t);window._matchUpdateQueue.set(n,i);try{await i}catch(n){try{await async function(e,t){return new Promise(n=>{const i=window.pageYOffset;try{const a=e.querySelector(".live-scores-team.home .live-scores-score"),o=t.querySelector(".live-scores-team.home .live-scores-score");a&&o&&a.textContent!==o.textContent&&(a.textContent=o.textContent);const s=e.querySelector(".live-scores-team.away .live-scores-score"),r=t.querySelector(".live-scores-team.away .live-scores-score");s&&r&&s.textContent!==r.textContent&&(s.textContent=r.textContent);const c=e.querySelector(".live-scores-minute"),l=t.querySelector(".live-scores-minute");if(c&&l){const e=l.innerHTML;c.innerHTML!==e&&(c.innerHTML=e)}Math.abs(window.pageYOffset-i)>5&&window.scrollTo(0,i),n()}catch(e){n()}})}(e,t)}catch(e){}}finally{window._matchUpdateQueue.delete(n)}})(c.get(t),e).then(()=>{}).catch(n=>{try{updateMatchScores(c.get(t),e)}catch(e){}})},50):function(e,t,n){const i=e.cloneNode(!0),a=e.getAttribute("data-group-id")||"";let s=a?n.get(a):null;if(!s&&a&&t){let e=null;t.forEach(function(t){t.getAttribute("data-group-id")===a&&(e=t)}),e&&(s=function(e){const t=e.cloneNode(!0),n=document.querySelector("#live-scores .live-scores");return n?(n.appendChild(t),o&&"function"==typeof o.addTournamentFlag&&o.addTournamentFlag(d.$(t)),t):null}(e),s&&n.set(a,s))}if(!s){const t=e.getAttribute("data-tournament-id")||"";t&&n.forEach(function(e,n){s||e.getAttribute("data-tournament-id")!==t||(s=e)})}if(!s)return;let r=s,c=s.nextElementSibling;for(;c&&c.classList.contains("live-scores-match");)r=c,c=c.nextElementSibling;r.insertAdjacentElement("afterend",i),i.style.opacity="0",i.style.transform="translateY(-10px)",setTimeout(function(){i.style.transition="all 0.3s ease",i.style.opacity="1",i.style.transform="translateY(0)"},100)}(e,r,l)}}),"live"===n&&function(t,n,i){const a=["finished","canceled","postponed"];n.forEach(e=>{j.has(e)&&j.delete(e)}),t.forEach((t,i)=>{if(!n.has(i)){const n=e&&e.toString()===i.toString(),o=window.LiveScoreApp.DetailClosingFlags&&window.LiveScoreApp.DetailClosingFlags.isClosing(i),r=!!n||!!o,c=t.getAttribute("data-status");if(a.includes(c))j.delete(i),r||(t.style.transition="all 0.3s ease",t.style.opacity="0",t.style.transform="translateY(-10px)",setTimeout(()=>{H(t),t.remove()},300));else{const e=(j.get(i)||0)+1;if(j.set(i,e),e>=1){j.delete(i),t.setAttribute("data-status","finished"),t.setAttribute("data-status-description","Ended");const e=t.querySelector(".live-scores-minute");e&&(e.innerHTML='<span class="match-status match-status-finished">Bitti</span>'),s&&"function"==typeof s.updateMatchStatus&&s.updateMatchStatus(d.$(t)),r||setTimeout(()=>{t.style.transition="all 0.3s ease",t.style.opacity="0",t.style.transform="translateY(-10px)",setTimeout(()=>{H(t),t.remove()},300)},2e3)}}}}),i&&i.size>0&&t.forEach((t,o)=>{if(n.has(o)){const n=i.get(o);if(n&&a.includes(n)){if(e&&e.toString()===o.toString())return;j.delete(o),setTimeout(()=>{t.style.transition="all 0.3s ease",t.style.opacity="0",t.style.transform="translateY(-10px)",setTimeout(()=>{H(t),t.remove()},300)},2e3)}}})}(c,p,u)}(t,n)}else 0===document.querySelectorAll(".live-scores-match").length&&d.$("#live-scores").html('<div class="live-scores-no-live-events">Veri işlenirken bir hata oluştu. Lütfen daha sonra tekrar deneyin.</div>')}function E(e,t){const n=e.querySelector(".live-scores-team.home .live-scores-score"),i=e.querySelector(".live-scores-team.away .live-scores-score"),a=t.querySelector(".live-scores-team.home .live-scores-score"),o=t.querySelector(".live-scores-team.away .live-scores-score"),s=n?n.textContent:"",r=i?i.textContent:"",c=a?a.textContent:"",l=o?o.textContent:"";return{hasChanges:s!==c||r!==l,home:{element:n,oldValue:s,newValue:c,hasGoal:parseInt(c)>parseInt(s)},away:{element:i,oldValue:r,newValue:l,hasGoal:parseInt(l)>parseInt(r)}}}function D(e,t){const n=e.querySelector(".live-scores-minute"),i=t.querySelector(".live-scores-minute"),a=e.querySelector(".live-scores-time"),o=t.querySelector(".live-scores-time"),s=(n?n.innerHTML:"").trim(),r=(i?i.innerHTML:"").trim(),c=(a?a.textContent:"").trim(),l=(o?o.textContent:"").trim();return{hasChanges:s!==r||c!==l,minute:{element:n,newValue:r},time:{element:a,newValue:l}}}function _(e,t){const n=e.getAttribute("data-home-red-cards")||"0",i=e.getAttribute("data-away-red-cards")||"0",a=t.getAttribute("data-home-red-cards")||"0",o=t.getAttribute("data-away-red-cards")||"0";return{hasChanges:n!==a||i!==o,home:{oldValue:n,newValue:a},away:{oldValue:i,newValue:o}}}function P(e,t){const n=e.getAttribute("data-status"),i=e.getAttribute("data-status-description")||"",a=t.getAttribute("data-status");let o=t.getAttribute("data-status-description")||"";const s=e.getAttribute("data-match-id");if(s&&window.LiveScoreApp&&window.LiveScoreApp.LiveMatches){const e=window.LiveScoreApp.LiveMatches.get(s);e&&e.status&&e.status.description&&(o=e.status.description)}return{hasChanges:n!==a||i!==o,status:a,description:o}}function U(e,t){const n=[];return["data-has-statistics","data-aggregated-winner-code","data-home-formation","data-away-formation"].forEach(i=>{const a=e.getAttribute(i),o=t.getAttribute(i);a!==o&&null!==o&&n.push({attribute:i,value:o})}),{hasChanges:n.length>0,changes:n}}function N(e,t,n){const i=e.querySelector(`.live-scores-team.${t} .live-scores-name`);if(i){i.querySelectorAll(".match-list-red-card-icon").forEach(e=>e.remove());const e=parseInt(n);for(let t=0;t<e;t++){const e=document.createElement("i");e.className="fas fa-square match-list-red-card-icon",e.setAttribute("aria-label","Kırmızı Kart"),i.appendChild(document.createTextNode(" ")),i.appendChild(e)}}}function H(e){let t=e.previousElementSibling;for(;t&&!t.classList.contains("live-scores-tournament-card");)t=t.previousElementSibling;if(!t)return;if("0"===t.style.opacity)return;let n=!1,i=t.nextElementSibling;for(;i&&!i.classList.contains("live-scores-tournament-card");){if(i.classList.contains("live-scores-match")&&"0"!==i.style.opacity){n=!0;break}i=i.nextElementSibling}n||(t.style.transition="all 0.3s ease",t.style.opacity="0",setTimeout(()=>t.remove(),300))}m="live";const j=new Map;function R(e,t){if(s&&"function"==typeof s.flashScoreCard){const n=e.closest(".live-scores-match")?.getAttribute("data-match-id"),i=e.closest(".live-scores-team").classList.contains("home")?"home":"away";s.flashScoreCard(d.$(e),t,n,i)}}function F(){setTimeout(function(){d.$(".live-scores-match, .match-card").each(function(){const t=d.$(this),n=t.data("match-id");n&&(s.updateMatchStatus(t),e===n&&c.updateMatchDetailScores(n))}),d.$(".live-scores-tournament-card").each(function(){o.addTournamentFlag(d.$(this))}),o.attachMatchClickEvents(),l.appendSeoText()},0)}function z(){if(!window.LiveScoreApp.LiveMatches||0===window.LiveScoreApp.LiveMatches.size)return{removedCount:0,totalSize:0};const e=Date.now(),t=n.optimizationSettings.liveMatchesConfig;let i=0;const a=window.LiveScoreApp.LiveMatches.size;for(const[n,a]of window.LiveScoreApp.LiveMatches.entries()){if(!a.timestamp){window.LiveScoreApp.LiveMatches.delete(n),i++;continue}const o=e-a.timestamp;let s=!1;switch(a.status||"unknown"){case"finished":s=o>t.finishedMatchRetention;break;case"notstarted":s=o>t.notStartedMatchRetention;break;case"canceled":s=o>t.canceledMatchRetention;break;case"postponed":s=o>t.postponedMatchRetention;break;case"inprogress":s=!1;break;default:s=o>6e5}s&&(window.LiveScoreApp.LiveMatches.delete(n),i++)}const o=window.LiveScoreApp.LiveMatches.size;if(o>t.maxLiveMatches){const e=[];for(const[t,n]of window.LiveScoreApp.LiveMatches.entries())"finished"===n.status&&n.timestamp&&e.push({matchId:t,timestamp:n.timestamp});e.sort((e,t)=>e.timestamp-t.timestamp);const n=o-t.maxLiveMatches,a=Math.min(n,e.length);for(let t=0;t<a;t++)window.LiveScoreApp.LiveMatches.delete(e[t].matchId),i++}return{removedCount:i,totalSize:window.LiveScoreApp.LiveMatches.size,initialSize:a}}return{init:function(){function t(e,t,n){const i=parseInt(e,10),a=parseInt(t,10),o=parseInt(n,10);if(isNaN(i)||isNaN(a)||isNaN(o))return!1;if(a<1||a>12)return!1;if(i<1||i>31)return!1;if(o<2e3||o>2099)return!1;const s=a-1;let r,c;try{if(r=new Date(o,s,i),r.setHours(0,0,0,0),c=new Date,c.setHours(0,0,0,0),isNaN(r.getTime())||isNaN(c.getTime()))return!1}catch(e){return!1}const l=(r.getTime()-c.getTime())/864e5;return Math.abs(l)>=.5}if(o.setupEventListeners(),M(),document.addEventListener("DOMContentLoaded",function(){document.querySelector(".live-scores-match:not(.skeleton-match)")&&F();let e=new Date;if("all"===m){const t=document.getElementById("date-picker");t&&t._flatpickr&&t._flatpickr.selectedDates.length&&(e=t._flatpickr.selectedDates[0])}r.updateMetaTags(m,e),window.LiveScoreApp.fixPageTitle=function(e){if("undefined"===document.title||document.title.includes("undefined")||""===document.title||"Maçlar Yükleniyor... - Canlı Skor"===document.title){const t=window.LiveScoreApp.Modules&&window.LiveScoreApp.Modules.MetaTags,n=window.LiveScoreApp.Utils&&window.LiveScoreApp.Utils.jQuery;if(!t||"function"!=typeof t.updateMetaTags||!n)return document.title=e?"Canlı Skor - Maç Programı ve Sonuçları | Sporkolik":"Canlı Skor - Güncel Maç Sonuçları | Sporkolik",!0;{const i=e?"all":"live";let a=new Date;if("all"===i&&n.$("#date-picker").length){const e=n.$("#date-picker").val();if(e&&/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(e)){const t=e.split("/");a=new Date(t[2],t[1]-1,t[0]),isNaN(a.getTime())&&(a=new Date)}}try{return t.updateMetaTags(i,a),!0}catch(t){return document.title=e?"Canlı Skor - Maç Programı ve Sonuçları | Sporkolik":"Canlı Skor - Güncel Maç Sonuçları | Sporkolik",!0}}}return!1};const t=function(){window.LiveScoreApp.fixPageTitle(u)};t(),p?p.setInterval(t,300,"page-title-check"):setInterval(t,300)}),S||$(null,null,null,"live"),window.LiveScoreApp.Components.PullToRefresh&&"function"==typeof window.LiveScoreApp.Components.PullToRefresh.init&&window.LiveScoreApp.Components.PullToRefresh.init(),v=function(){if(L)return;const n=(d.$("#date-picker").val()||"").split("/");if(e){if(A++,A<5)return;A=0}else A=0;u?t(n[0],n[1],n[2])?window.LiveScoreApp.hasHistoricalDataLoaded||(h=!0,$(n[0],n[1],n[2],"all",!1),window.LiveScoreApp.hasHistoricalDataLoaded=!0):k().then(()=>{window.LiveScoreApp.statusUpdateCounter||(window.LiveScoreApp.statusUpdateCounter=0),window.LiveScoreApp.statusUpdateCounter++,window.LiveScoreApp.statusUpdateCounter>=5&&($(n[0],n[1],n[2],"all",!1),window.LiveScoreApp.statusUpdateCounter=0)}):($(null,null,null,"live",!1),window.LiveScoreApp.hasHistoricalDataLoaded=!1)},p){const e=window.LiveScoreApp.Constants.getCacheTTL("LIVE_SCORES","live");p.setInterval(v,e,"main-score-update")}else{const e=window.LiveScoreApp.Constants.getCacheTTL("LIVE_SCORES","live");setInterval(function(){const e=(d.$("#date-picker").val()||"").split("/");if(u){const n=t(e[0],e[1],e[2]);if(n&&window.LiveScoreApp.hasHistoricalDataLoaded){new Date(parseInt(e[2]),parseInt(e[1])-1,parseInt(e[0]));return void(new Date).setHours(0,0,0,0)}n?($(e[0],e[1],e[2],"all",!1),window.LiveScoreApp.hasHistoricalDataLoaded=!0):k().then(()=>{window.LiveScoreApp.statusUpdateCounter||(window.LiveScoreApp.statusUpdateCounter=0),window.LiveScoreApp.statusUpdateCounter++,window.LiveScoreApp.statusUpdateCounter>=5&&($(e[0],e[1],e[2],"all",!1),window.LiveScoreApp.statusUpdateCounter=0)})}else $(null,null,null,"live",!1),window.LiveScoreApp.hasHistoricalDataLoaded=!1},e)}},fetchLiveScores:$,updateLiveMatchesOnly:k,clearTimers:function(){if(window._matchUpdateQueue){for(const[e,t]of window._matchUpdateQueue)window._matchUpdateQueue.delete(e);window._matchUpdateQueue.clear()}window.LiveScoreApp&&window.LiveScoreApp.clearAllPendingUpdates&&window.LiveScoreApp.clearAllPendingUpdates(),p&&(p.clearInterval("page-title-check"),p.clearInterval("main-score-update"),p.clearInterval("livematches-cleanup"))},cleanupCache:i.cleanupCache,performBatchCleanup:i.performBatchCleanup,cleanupCacheByDataType:i.cleanupCacheByDataType,getCacheStats:i.getCacheStats,checkURLParameters:M,startMainTimer:x,cleanupLiveMatches:z,initLiveMatchesCleanup:function(){const e=n.optimizationSettings.liveMatchesConfig;p?p.setInterval(function(){z().removedCount>0&&window.LiveScoreApp.debugMode},e.cleanupInterval,"livematches-cleanup"):setInterval(function(){z().removedCount>0&&window.LiveScoreApp.debugMode},e.cleanupInterval),setTimeout(z,5e3)},getSelectedMatchId:function(){return e},setSelectedMatchId:function(t){e=t},getCurrentTab:function(){return m},setCurrentTab:function(e){m=e},getIsAllMatchesSelected:function(){return u},setIsAllMatchesSelected:function(e){u=e},getIsSwitchingTab:function(){return w},setIsSwitchingTab:function(e){w=e}}}(),window.LiveScoreApp.LiveScores.init(),setTimeout(function(){window.LiveScoreApp.LiveScores.initLiveMatchesCleanup&&window.LiveScoreApp.LiveScores.initLiveMatchesCleanup()},1e3),window.LiveScoreApp.emergencyMemoryCleanup=function(){const e=window.LiveScoreApp.LiveMatches.size,t=Date.now()-12e4;let n=0;for(let[e,i]of window.LiveScoreApp.LiveMatches.entries())(!i.timestamp||i.timestamp<t)&&(window.LiveScoreApp.LiveMatches.delete(e),n++);return window.LiveScoreApp.LiveMatches.size>150&&Array.from(window.LiveScoreApp.LiveMatches.entries()).sort((e,t)=>(e[1].timestamp||0)-(t[1].timestamp||0)).slice(0,100).forEach(([e])=>{window.LiveScoreApp.LiveMatches.delete(e),n++}),{beforeSize:e,afterSize:window.LiveScoreApp.LiveMatches.size,removedCount:n,memoryFreed:!0}},window.LiveScoreApp.getLiveMatchesStats=function(){const e=Date.now();let t=0,n=0,i=e,a=0;for(let[o,s]of window.LiveScoreApp.LiveMatches.entries()){const o=s.timestamp||0;o&&e-o<3e5?t++:n++,o<i&&(i=o),o>a&&(a=o)}return{totalSize:window.LiveScoreApp.LiveMatches.size,validEntries:t,expiredEntries:n,oldestEntryAge:i?Math.floor((e-i)/1e3):0,newestEntryAge:a?Math.floor((e-a)/1e3):0,memoryHealthy:window.LiveScoreApp.LiveMatches.size<280,recommendedAction:window.LiveScoreApp.LiveMatches.size>250?"cleanup_needed":"healthy"}},e(document).ajaxError(function(e,t,n,i){if(window.LiveScoreApp&&window.LiveScoreApp.fixPageTitle){const e=window.LiveScoreApp.LiveScores,t=!(!e||!e.getIsAllMatchesSelected)&&e.getIsAllMatchesSelected();window.LiveScoreApp.fixPageTitle(t),setTimeout(function(){("undefined"===document.title||document.title.includes("undefined")||""===document.title)&&(document.title="Canlı Skor")},100)}})});