/* OK ITHAKI V249526R7 — PROFESSIONAL EXTERNAL NOTIFICATIONS / PER-APP CALENDAR / COMMUNITY FIRST PAINT */
(function(){
'use strict';
if(window.__ITHAKI_V249526R7_OWNER__)return;
window.__ITHAKI_V249526R7_OWNER__={version:'V249526R7',professionalExternalOrganizer:true,perAppCalendar:true,newestFirst:true,importantArchiveAction:true,communityFirstPaint:true,at:Date.now()};
const EXTERNAL_NOTIFICATION_ORGANIZER_R7=true,PER_APP_CALENDAR_R7=true,NEWEST_FIRST_R7=true,IMPORTANT_ARCHIVE_ACTION_R7=true,COMMUNITY_FIRST_PAINT_R7=true;
const EXTERNAL_MESSAGES_TYPE_TIME_CALENDAR_R10F17=true;
const I=()=>window.ITH=window.ITH||{};
const $=id=>document.getElementById(id);
const esc=v=>String(v==null?'':v).replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
const norm=v=>String(v||'').normalize('NFD').replace(/[\u0300-\u036f]/g,'').replace(/\s+/g,' ').trim().toLocaleLowerCase('el');
const bridge=()=>window.OKITHAKI_ANDROID||window.AndroidBridge||null;
function nativeCall(name,...args){try{const b=bridge();if(b&&typeof b[name]==='function')return b[name](...args)}catch(e){console.warn('R7 native',name,e)}return null}
function toast(m,ms=5000){try{if(typeof window.toast==='function')return window.toast(m,ms);if(I().toast)return I().toast(m,ms)}catch(e){}console.log(m)}
function bool(v){return v===true||v==='true'||v===1||v==='1'}
function itemTime(x){return Number(x.created_at||x.posted_at||x.updated_at||0)}
function appKey(x){return String(x.package_name||('source:'+String(x.source||'other')))}
function appName(x){return String(x.app_label||({email:'Email',viber:'Viber',sms:'SMS/MMS',other:'Άλλη εφαρμογή',shared:'Κοινοποίηση'}[x.source]||x.package_name||'Εφαρμογή'))}
function sourceIcon(x){const s=String(x.source||'other');return s==='email'?'✉️':s==='viber'?'📞':s==='sms'?'💬':s==='shared'?'📎':'🔔'}
function parseItems(){let native=[];try{native=JSON.parse(String(nativeCall('getExternalMessageCenterItemsV249477')||'[]'))||[]}catch(e){}const synced=Array.isArray(window.__ITHAKI_EXTERNAL_SYNC_ITEMS_V249525__)?window.__ITHAKI_EXTERNAL_SYNC_ITEMS_V249525__:[];return native.concat(synced.map(x=>Object.assign({synced_from_phone:true},x))).filter(Boolean)}
function semanticKey(x){if(x.notification_key)return'key|'+x.notification_key;const t=Math.floor(itemTime(x)/60000);return'legacy|'+appKey(x)+'|'+norm(x.title)+'|'+norm(x.body)+'|'+t}
function dedupe(items){const m=new Map();for(const raw of items){const x=Object.assign({},raw),k=semanticKey(x),old=m.get(k);if(!old){m.set(k,x);continue}const newer=Number(x.updated_at||itemTime(x))>=Number(old.updated_at||itemTime(old))?x:old,older=newer===x?old:x;m.set(k,Object.assign({},older,newer,{important:bool(newer.important)||bool(older.important),archived:bool(newer.archived)||bool(older.archived),note:String(newer.note||older.note||''),action_note:String(newer.action_note||older.action_note||newer.note||older.note||''),action_status:String(newer.action_status||older.action_status||'none'),due_at:Number(newer.due_at||older.due_at||0)}))}return [...m.values()].sort((a,b)=>itemTime(b)-itemTime(a))}
function allItems(){return dedupe(parseItems())}
function save(x){x.updated_at=Date.now();const r=nativeCall('upsertExternalMessageCenterItemV249477',JSON.stringify(x));return r}
function deleteItem(id){return nativeCall('deleteExternalMessageCenterItemV249477',String(id||''))}
function accessEnabled(){return bool(nativeCall('isNotificationAccessEnabledV249477'))}
function consent(src){return bool(nativeCall('getExternalSourceConsentV249477',src))}
function setConsent(src,on){nativeCall('setExternalSourceConsentV249477',src,!!on)}
function mirrorEnabled(){return bool(nativeCall('getExternalMirrorEnabledV249527'))}
function setMirror(on){nativeCall('setExternalMirrorEnabledV249527',!!on)}
function formatDate(ms){if(!ms)return'';try{return new Date(Number(ms)).toLocaleString('el-GR',{day:'2-digit',month:'2-digit',year:'numeric',hour:'2-digit',minute:'2-digit'})}catch(e){return''}}
function toLocalInput(ms){if(!ms)return'';const d=new Date(Number(ms)-new Date().getTimezoneOffset()*60000);return d.toISOString().slice(0,16)}
function fromLocalInput(v){const t=Date.parse(String(v||''));return Number.isFinite(t)?t:0}
function diagnostics(){let d={};try{d=JSON.parse(String(nativeCall('getExternalNotificationDiagnosticsV249527')||'{}'))||{}}catch(e){}return d}
let state={view:'inbox',app:'all',search:'',refreshTimer:0,items:[]};
function addCss(){if($('ith527Css'))return;const s=document.createElement('style');s.id='ith527Css';s.textContent=`
#ith527ExternalOrganizer{position:fixed;inset:0;z-index:2147483646;background:radial-gradient(circle at 18% 0,rgba(16,83,91,.33),transparent 32%),linear-gradient(180deg,#03111d,#071b29 48%,#04131f);color:#f7fbff;overflow:auto;padding:calc(8px + env(safe-area-inset-top)) 8px calc(86px + env(safe-area-inset-bottom));font-family:system-ui,sans-serif}.ith527Shell{width:min(1120px,100%);margin:auto}.ith527Top{position:sticky;top:0;z-index:9;display:flex;align-items:center;gap:8px;padding:9px;border:1px solid rgba(135,211,255,.22);border-radius:18px;background:rgba(4,20,33,.94);backdrop-filter:blur(18px)}.ith527Top h2{font-size:17px;margin:0;flex:1}.ith527Btn{min-height:42px;border-radius:13px;border:1px solid rgba(146,211,255,.27);background:rgba(17,55,78,.92);color:#fff;padding:8px 11px;font-weight:850}.ith527Btn.on{background:#0c674d;border-color:#59e2ae}.ith527Btn.warn{background:#6c4c0d}.ith527Btn.danger{background:#701d26}.ith527Grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:9px}.ith527Card{margin:10px 0;padding:12px;border-radius:18px;border:1px solid rgba(139,209,255,.18);background:linear-gradient(145deg,rgba(13,44,62,.96),rgba(4,22,36,.96));box-shadow:0 14px 35px rgba(0,0,0,.25)}.ith527Status{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.ith527Dot{width:10px;height:10px;border-radius:50%;background:#ef6d76}.ith527Dot.ok{background:#5fe0a9}.ith527Tabs,.ith527Apps{display:flex;gap:7px;overflow-x:auto;padding:7px 1px;scrollbar-width:none}.ith527Tabs::-webkit-scrollbar,.ith527Apps::-webkit-scrollbar{display:none}.ith527Search{width:100%;min-height:44px;box-sizing:border-box;border-radius:14px;border:1px solid rgba(146,211,255,.24);background:#061b2b;color:#fff;padding:10px;font:inherit}.ith527Msg{display:grid;gap:8px}.ith527Meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.ith527Badge{font-size:11px;font-weight:900;border-radius:999px;padding:3px 8px;background:#25516a}.ith527Badge.important{background:#785c12;color:#ffe69a}.ith527Badge.archived{background:#4e5361}.ith527Title{display:grid;grid-template-columns:42px 1fr;gap:10px;align-items:start;border:0;background:transparent;color:inherit;text-align:left;padding:0;cursor:pointer}.ith527AppIcon{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:rgba(255,255,255,.08);font-size:21px}.ith527Title b{display:block;font-size:15px}.ith527Title p{margin:4px 0 0;white-space:pre-wrap;line-height:1.38;color:rgba(242,249,255,.86)}.ith527Actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:7px}.ith527Field{display:grid;gap:5px}.ith527Field label{font-size:11px;font-weight:900;color:#b7d8ea}.ith527Field input,.ith527Field select{width:100%;box-sizing:border-box;min-height:42px;border-radius:12px;border:1px solid rgba(146,211,255,.23);background:#061a29;color:#fff;padding:8px}.ith527ActionLine{display:grid;grid-template-columns:minmax(180px,1fr) minmax(150px,.5fr) minmax(180px,.6fr) auto;gap:7px;align-items:end}.ith527CalendarDay{border-left:4px solid #5ad9a7;padding-left:10px;margin:12px 0}.ith527CalendarApp{display:flex;justify-content:space-between;gap:10px;align-items:center}.ith527Empty{text-align:center;padding:28px 12px;color:rgba(230,243,251,.74)}.ith527Privacy{border-color:rgba(255,218,102,.35);background:rgba(77,54,10,.38)}.ith527Small{font-size:12px;line-height:1.42;color:rgba(231,245,253,.76)}
html[data-ithaki-community-r7-pending="1"] body[data-page="spaces"] #spacesPage{visibility:hidden!important;opacity:0!important;pointer-events:none!important}html[data-ithaki-community-r7-pending="1"] body[data-page="spaces"] .main::after{content:"Φόρτωση κοινοτήτων…";position:fixed;inset:var(--top,55px) 0 var(--bar,70px);z-index:100;display:grid;place-items:center;color:#ffe39a;background:linear-gradient(180deg,#061724,#04121d);font-weight:900}
@media(max-width:720px){.ith527ActionLine{grid-template-columns:1fr}.ith527Actions{grid-template-columns:1fr 1fr}.ith527Top h2{font-size:15px}}
`;document.head.appendChild(s)}
function privacyAccepted(){try{return localStorage.getItem('ith477_external_privacy_notice')==='1'}catch(e){return false}}
function setPrivacyAccepted(){try{localStorage.setItem('ith477_external_privacy_notice','1')}catch(e){}}
function close(){clearInterval(state.refreshTimer);state.refreshTimer=0;$('ith527ExternalOrganizer')?.remove();return false}
function shell(){close();addCss();const d=document.createElement('section');d.id='ith527ExternalOrganizer';d.innerHTML='<div class="ith527Shell"><header class="ith527Top"><button class="ith527Btn" data-r7="close">‹</button><h2>🔔 Επαγγελματικό Κέντρο Ειδοποιήσεων</h2><button class="ith527Btn" data-r7="refresh">Ανανέωση</button><button class="ith527Btn danger" data-r7="close">×</button></header><div id="ith527Body"></div></div>';document.body.appendChild(d);d.addEventListener('click',handleClick);d.addEventListener('change',handleChange);d.addEventListener('input',handleInput);return d}
function sourceCards(items){const access=accessEnabled(),defs=[['email','✉️','Email'],['viber','📞','Viber'],['sms','💬','SMS/MMS'],['other','🔔','Άλλες εφαρμογές']];return defs.map(([s,ic,n])=>{const on=consent(s),count=items.filter(x=>x.source===s).length;return'<button class="ith527Card" data-r7-source="'+s+'"><div class="ith527Status"><span class="ith527AppIcon">'+ic+'</span><div><b>'+(on?'✅ ':'○ ')+n+'</b><div class="ith527Small">'+(on?(count+' αποθηκευμένες · μόνο νέες ειδοποιήσεις'):'Πατήστε για ενεργοποίηση')+'</div></div></div></button>'}).join('')}
function renderHeader(items){const d=diagnostics(),access=accessEnabled(),email=consent('email'),mirror=mirrorEnabled();return'<section class="ith527Card '+(!access||!email?'ith527Privacy':'')+'"><div class="ith527Status"><span class="ith527Dot '+(access?'ok':'')+'"></span><b>Άδεια Android: '+(access?'Ενεργή':'Ανενεργή')+'</b><button class="ith527Btn '+(access?'on':'warn')+'" data-r7="access">'+(access?'Ρυθμίσεις άδειας':'Δώσε άδεια')+'</button><button class="ith527Btn '+(mirror?'on':'')+'" data-r7="mirror">Δεύτερη ειδοποίηση ΙΘΑΚΗΣ: '+(mirror?'ΝΑΙ':'ΟΧΙ')+'</button></div><p class="ith527Small">Τα email δεν διαβάζονται από το inbox. Αποθηκεύονται μόνο οι νέες ειδοποιήσεις που εμφανίζει το Gmail/Outlook μετά την άδεια και την ενεργοποίηση Email. Τα δεδομένα μένουν κρυπτογραφημένα στο κινητό.</p><div class="ith527Small">Native build: '+esc(d.version_name||'R7 απαιτεί νέο APK')+' · αποθηκευμένα: '+items.length+'</div></section><section class="ith527Grid">'+sourceCards(items)+'</section>'}
function viewTabs(){const tabs=[['inbox','📥 Νέα'],['all','🗂️ Όλα'],['unread','● Αδιάβαστα'],['important','⭐ Σημαντικά'],['calendar','📅 Ημερολόγιο'],['archived','📦 Αρχείο']];return'<div class="ith527Tabs">'+tabs.map(([k,n])=>'<button class="ith527Btn '+(state.view===k?'on':'')+'" data-r7-view="'+k+'">'+n+'</button>').join('')+'</div>'}
function appTabs(items){const m=new Map();for(const x of items){const k=appKey(x);if(!m.has(k))m.set(k,{name:appName(x),count:0});m.get(k).count++}const arr=[...m.entries()].sort((a,b)=>a[1].name.localeCompare(b[1].name,'el'));return'<div class="ith527Apps"><button class="ith527Btn '+(state.app==='all'?'on':'')+'" data-r7-app="all">Όλες οι εφαρμογές</button>'+arr.map(([k,v])=>'<button class="ith527Btn '+(state.app===k?'on':'')+'" data-r7-app="'+esc(k)+'">'+esc(v.name)+' · '+v.count+'</button>').join('')+'</div>'}
function filterItems(items){const q=norm(state.search);return items.filter(x=>{if(state.app!=='all'&&appKey(x)!==state.app)return false;if(q&&!norm([x.title,x.body,x.app_label,x.package_name,x.action_note,x.note].join(' ')).includes(q))return false;if(state.view==='inbox')return !bool(x.archived);if(state.view==='unread')return bool(x.unread)&&!bool(x.archived);if(state.view==='important')return bool(x.important)&&!bool(x.archived);if(state.view==='archived')return bool(x.archived);if(state.view==='calendar')return true;return true})}
function card(x){const id=esc(x.id),due=Number(x.due_at||0),status=String(x.action_status||'none');return'<article class="ith527Card ith527Msg" data-r7-id="'+id+'"><div class="ith527Meta"><span class="ith527Badge">'+esc(appName(x))+'</span><span class="ith527Badge">'+esc(String(x.source||'other').toUpperCase())+'</span>'+(bool(x.unread)?'<span class="ith527Badge">ΝΕΟ</span>':'')+(bool(x.important)?'<span class="ith527Badge important">⭐ ΣΗΜΑΝΤΙΚΟ</span>':'')+(bool(x.archived)?'<span class="ith527Badge archived">📦 ΑΡΧΕΙΟ</span>':'')+'<small>'+esc(formatDate(itemTime(x)))+'</small></div><button class="ith527Title" data-r7-action="open"><span class="ith527AppIcon">'+sourceIcon(x)+'</span><span><b>'+esc(x.title||'Ειδοποίηση')+'</b><p>'+esc(x.body||'')+'</p></span></button><div class="ith527Actions"><button class="ith527Btn" data-r7-action="open">Άνοιγμα εφαρμογής</button><button class="ith527Btn '+(bool(x.important)?'on':'')+'" data-r7-action="important">⭐ '+(bool(x.important)?'Σημαντικό':'Μη σημαντικό')+'</button><button class="ith527Btn '+(bool(x.archived)?'on':'')+'" data-r7-action="archive">📦 '+(bool(x.archived)?'Επαναφορά':'Αρχειοθέτηση')+'</button><button class="ith527Btn" data-r7-action="read">'+(bool(x.unread)?'✓ Διαβάστηκε':'● Αδιάβαστο')+'</button><button class="ith527Btn danger" data-r7-action="delete">🗑️ Διαγραφή</button></div><div class="ith527ActionLine"><div class="ith527Field"><label>Ενέργεια / σημείωση</label><input data-r7-action-note value="'+esc(x.action_note||x.note||'')+'" placeholder="Τι πρέπει να κάνω;"></div><div class="ith527Field"><label>Κατάσταση</label><select data-r7-action-status><option value="none" '+(status==='none'?'selected':'')+'>Καμία</option><option value="todo" '+(status==='todo'?'selected':'')+'>Να γίνει</option><option value="doing" '+(status==='doing'?'selected':'')+'>Σε εξέλιξη</option><option value="done" '+(status==='done'?'selected':'')+'>Ολοκληρώθηκε</option></select></div><div class="ith527Field"><label>Ημερολόγιο</label><input type="datetime-local" data-r7-due value="'+esc(toLocalInput(due))+'"></div><button class="ith527Btn on" data-r7-action="save-action">Αποθήκευση</button></div></article>'}
function calendarTypeR10F17(x){const s=String(x.source||'other').toLowerCase(),p=String(x.package_name||'').toLowerCase();if(s==='email'||/mail|gmail|outlook/.test(p))return['email','✉️ Email'];if(s==='sms'||/sms|mms|message/.test(p))return['sms','💬 SMS / MMS'];if(s==='viber'||/viber/.test(p))return['viber','📞 Viber'];if(/whatsapp/.test(p))return['whatsapp','🟢 WhatsApp'];if(/telegram/.test(p))return['telegram','✈️ Telegram'];if(s==='shared')return['shared','📎 Κοινοποιήσεις'];return['other','🔔 Άλλες ειδοποιήσεις']}
function calendar(items){const a=filterItems(items).slice().sort((x,y)=>Number(y.due_at||itemTime(y))-Number(x.due_at||itemTime(x))),days=new Map();for(const x of a){const when=Number(x.due_at||itemTime(x)||Date.now()),d=new Date(when),day=d.toLocaleDateString('el-GR',{weekday:'long',day:'2-digit',month:'long',year:'numeric'}),type=calendarTypeR10F17(x);if(!days.has(day))days.set(day,new Map());const types=days.get(day);if(!types.has(type[0]))types.set(type[0],{label:type[1],items:[]});types.get(type[0]).items.push(Object.assign({},x,{__when:when}))}if(!a.length)return'<div class="ith527Card ith527Empty">Δεν υπάρχουν εξωτερικά μηνύματα ή ειδοποιήσεις.</div>';return[...days.entries()].map(([day,types])=>'<section class="ith527Card ith527CalendarDay"><h3>📅 '+esc(day)+'</h3>'+[...types.values()].map(g=>'<div class="ith527CalendarTypeR10F17"><h4>'+esc(g.label)+' · '+g.items.length+'</h4>'+g.items.map(x=>'<div class="ith527Card ith527CalendarApp" data-r7-id="'+esc(x.id)+'"><div><b><span class="ith527CalendarTimeR10F17">'+esc(new Date(x.__when).toLocaleTimeString('el-GR',{hour:'2-digit',minute:'2-digit'}))+'</span> · '+esc(appName(x))+'</b><div>'+esc(x.action_note||x.title||'Ειδοποίηση')+'</div><small>'+esc(x.body||'')+'</small></div><button class="ith527Btn" data-r7-action="open">Άνοιγμα</button></div>').join('')+'</div>').join('')+'</section>').join('')}
function render(){const root=$('ith527Body');if(!root)return;state.items=allItems();const items=state.items;root.innerHTML=renderHeader(items)+'<section class="ith527Card">'+viewTabs()+appTabs(items)+'<input id="ith527Search" class="ith527Search" placeholder="Αναζήτηση σε εφαρμογή, τίτλο, κείμενο ή ενέργεια" value="'+esc(state.search)+'"></section><div id="ith527List">'+(state.view==='calendar'?calendar(items):(filterItems(items).map(card).join('')||'<div class="ith527Card ith527Empty">Δεν υπάρχουν στοιχεία σε αυτή την προβολή.</div>'))+'</div>'}
function itemByCard(el){const card=el.closest('[data-r7-id]'),id=card&&card.dataset.r7Id;return state.items.find(x=>String(x.id)===String(id))}
function openOriginal(x){if(!x)return false;x.unread=false;save(x);if(bool(nativeCall('openExternalNotificationV249477',String(x.id||''))))return true;if(x.package_name&&bool(nativeCall('openExternalPackageV249527',String(x.package_name))))return true;if(bool(nativeCall('openExternalSourceAppV249477',String(x.source||''))))return true;toast(x.synced_from_phone?'Η αρχική εφαρμογή ανοίγει μόνο στο κινητό που συνέλεξε την ειδοποίηση.':'Δεν βρέθηκε εφαρμογή για άνοιγμα.');return false}
function handleClick(e){const closeBtn=e.target.closest('[data-r7="close"]');if(closeBtn){e.preventDefault();return close()}const refresh=e.target.closest('[data-r7="refresh"]');if(refresh){e.preventDefault();return render()}const access=e.target.closest('[data-r7="access"]');if(access){e.preventDefault();nativeCall('openNotificationAccessSettingsV249477');return}const mirror=e.target.closest('[data-r7="mirror"]');if(mirror){e.preventDefault();setMirror(!mirrorEnabled());return render()}const src=e.target.closest('[data-r7-source]');if(src){e.preventDefault();const s=src.dataset.r7Source,on=consent(s);if(!on&&!confirm('Ενεργοποίηση μόνο για νέες ειδοποιήσεις '+s+'; Θα αποθηκεύονται κρυπτογραφημένα μόνο στο κινητό.'))return;setConsent(s,!on);return render()}const view=e.target.closest('[data-r7-view]');if(view){state.view=view.dataset.r7View;return render()}const app=e.target.closest('[data-r7-app]');if(app){state.app=app.dataset.r7App;return render()}const action=e.target.closest('[data-r7-action]');if(!action)return;const x=itemByCard(action);if(!x)return;const a=action.dataset.r7Action;if(a==='open')return openOriginal(x);if(a==='important')x.important=!bool(x.important);if(a==='archive')x.archived=!bool(x.archived);if(a==='read')x.unread=!bool(x.unread);if(a==='delete'){if(!confirm('Να διαγραφεί οριστικά αυτή η τοπική εγγραφή;'))return;deleteItem(x.id);return render()}if(a==='save-action'){const card=action.closest('[data-r7-id]');x.action_note=String(card.querySelector('[data-r7-action-note]')?.value||'').trim();x.note=x.action_note;x.action_status=String(card.querySelector('[data-r7-action-status]')?.value||'none');x.due_at=fromLocalInput(card.querySelector('[data-r7-due]')?.value||'');save(x);toast('Η ενέργεια αποθηκεύτηκε.');return render()}save(x);render()}
function handleChange(e){if(e.target.matches('[data-r7-action-status],[data-r7-due]')){const x=itemByCard(e.target);if(!x)return;const card=e.target.closest('[data-r7-id]');x.action_status=String(card.querySelector('[data-r7-action-status]')?.value||'none');x.due_at=fromLocalInput(card.querySelector('[data-r7-due]')?.value||'');save(x)}}
function handleInput(e){if(e.target.id==='ith527Search'){state.search=e.target.value;clearTimeout(handleInput.t);handleInput.t=setTimeout(render,180)}}
function open(initial){addCss();if(!bridge()){shell();$('ith527Body').innerHTML='<section class="ith527Card ith527Privacy"><h3>Απαιτείται το νέο Android APK R7</h3><p>Ο browser δεν μπορεί να διαβάζει ειδοποιήσεις άλλων εφαρμογών.</p></section>';return false}if(!privacyAccepted()){shell();$('ith527Body').innerHTML='<section class="ith527Card ith527Privacy"><h3>Τοπική και κρυπτογραφημένη αποθήκευση</h3><p>Οι ειδοποιήσεις, οι σημειώσεις, η αρχειοθέτηση και το ημερολόγιο μένουν μόνο σε αυτή τη συσκευή. Δεν διαβάζεται το παλιό inbox και δεν αποστέλλεται το περιεχόμενο στον server.</p><button class="ith527Btn on" id="ith527Accept">Κατάλαβα και ενεργοποιώ</button><button class="ith527Btn" data-r7="close">Όχι τώρα</button></section>';$('ith527Accept').onclick=()=>{setPrivacyAccepted();open(initial)};return false}state.view=initial==='calendar'?'calendar':(initial||'inbox');state.app='all';state.search='';shell();render();state.refreshTimer=setInterval(()=>{if($('ith527ExternalOrganizer')&&!document.activeElement?.matches('input,select,textarea'))render()},6000);return false}
function communityPending(){document.documentElement.setAttribute('data-ithaki-community-r7-pending','1')}
function communityReady(){if($('ith516Shell')){document.documentElement.removeAttribute('data-ithaki-community-r7-pending');document.documentElement.setAttribute('data-ithaki-community-r7-ready','1')}}
function installCommunityFirstPaint(){if(window.__ITHAKI_R10F13_SINGLE_COMMUNITY_RUNTIME__)return false;addCss();document.addEventListener('click',e=>{const q=e.target.closest('[data-page="spaces"],button,a');if(!q)return;const dp=String(q.getAttribute('data-page')||''),oc=String(q.getAttribute('onclick')||'');if(dp==='spaces'||/page\s*\(\s*['"]spaces['"]\s*\)/.test(oc))communityPending()},true);const p=$('spacesPage');if(p)new MutationObserver(()=>communityReady()).observe(p,{childList:true,subtree:false});communityReady()}
let lastExternal='';function pollBil(){if(window.__ITHAKI_R10F40_NOTIFICATION_EXCLUSIVE__)return;if(!bridge())return;const items=allItems(),x=items[0];if(!x)return;const k=String(x.id||semanticKey(x));if(!lastExternal){lastExternal=k;return}if(k===lastExternal)return;lastExternal=k;try{const f=I().showBilNotificationV249526||window.showBilNotificationV249526;if(typeof f==='function')f('Νέα ειδοποίηση από '+appName(x)+'. '+String(x.title||''))}catch(e){}}
function install(){addCss();I().openExternalMessageCenterCanonicalR10F12=open;window.openExternalMessageCenterCanonicalR10F12=open;I().openExternalMessageCenterCanonicalR10F11=open;window.openExternalMessageCenterCanonicalR10F11=open;I().openExternalMessageCenterV249477=open;I().openExternalMessagesCenterV249508=open;I().renderLocalProfessionalCalendarV249477=()=>open('calendar');I().openProfessionalNotificationOrganizerV249527=open;window.openProfessionalNotificationOrganizerV249527=open;installCommunityFirstPaint();setInterval(pollBil,5000);document.documentElement.setAttribute('data-ithaki-v249526r7','professional-external-organizer-calendar');try{localStorage.setItem('ith_frontend_build','V249526R7-professional-external-organizer')}catch(e){}}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',install,{once:true});else install();
})();
