/* OK ITHAKI V249526R10F12 — SOURCE FIX / SINGLE COMMUNITY START / DIRECT MESSAGE CENTER */
(function(){
'use strict';
if(window.__ITHAKI_R10F15_SINGLE_COMMUNITY_RUNTIME__){window.R10F15_COMPATIBILITY_DISABLED=true;return;}
if(window.__ITHAKI_V249526R10F12_OWNER__)return;
window.__ITHAKI_V249526R10F12_OWNER__={version:'V249526R10F12',sourcePatched:true,singleCommunityStart:true,directMessageCenter:true,noCommunityReopen:true,at:Date.now()};
window.COMMUNITY_SOURCE_PATCHED_R10F12=true;
window.COMMUNITY_PAGE_CHANGED_REOPEN_REMOVED_R10F12=true;
window.COMMUNITY_PERIODIC_REOPEN_REMOVED_R10F12=true;
window.PLUS_DIRECT_NOTIFICATION_MESSAGE_CENTER_R10F12=true;
window.R10F12_LAST_FRONTEND_OWNER=true;
const I=()=>window.ITH=window.ITH||{},$=id=>document.getElementById(id);
function closePlus(){const p=$('plusSheet');if(p)p.classList.remove('show')}
function toast(m,ms=6000){try{if(typeof I().toast==='function')return I().toast(m,ms)}catch(_e){}const t=$('toast');if(t){t.textContent=m;t.classList.add('show');setTimeout(()=>t.classList.remove('show'),ms)}}
function openMessageCenter(){closePlus();const f=I().openMessageCenterFromNotificationSettingsV249526||window.openMessageCenterFromNotificationSettingsV249526;if(typeof f==='function'){f.call(I());return true}const settings=I().openNotificationSettingsV249238||window.openNotificationSettingsV249238;if(typeof settings==='function'){settings.call(I());setTimeout(()=>document.querySelector('#ith526NotificationSettings [data-r3-action="external"],#ith526NotificationSettings [data-action="external"]')?.click(),0);return true}return false;}
function openCommunities(){closePlus();const f=I().activateSpacesPageV249516;if(typeof f==='function'){f.call(I());return true}toast('Η οθόνη Κοινοτήτων δεν είναι διαθέσιμη.');return false}
function capture(e){const ext=e.target?.closest?.('#plusSheet [data-r9plus="external"],#plusSheet [data-r8plus="external"]');if(ext){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();openMessageCenter();return}const spaces=e.target?.closest?.('#nav [data-page="spaces"],#plusSheet [data-r9plus="spaces"],#plusSheet [data-r8plus="spaces"]');if(spaces){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();openCommunities()}}
function install(){const o=I();const base=o.page;if(!base?.__r10f12){const page=function(id){if(String(id)==='spaces')return openCommunities();return typeof base==='function'?base.apply(this,arguments):false};page.__r10f12=true;o.page=page}o.openCommunitiesR10F12=openCommunities;o.openMessageCenterR10F12=openMessageCenter;window.openCommunitiesR10F12=openCommunities;window.openMessageCenterR10F12=openMessageCenter;window.addEventListener('click',capture,true);document.documentElement.setAttribute('data-ithaki-r10f12','source-fix-communities-message-center');try{localStorage.setItem('ith_frontend_build','V249526R10F12-source-fix-communities-message-center')}catch(_e){}}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',install,{once:true});else install();
})();
