/* OK ITHAKI V249499 RUNTIME OWN FEED / ADMIN INBOX / REAL STORY AVATARS
   Professional Center internal navigation, one normal Preview path for 24h stories,
   compact comment attachments and Android local-only External Message Center. */
(function(){
'use strict';
if(window.__ITHAKI_V249477_FULL__)return;
window.__ITHAKI_V249477_FULL__={version:'2.4.9.499-runtime-own-feed-admin-inbox-real-story-avatars',installedAt:Date.now()};
window.__ITHAKI_V249477_R1_STARTUP_FREEZE_FIX__={mutationObserverThrottled:true,bilRenderIdempotent:true};
window.__ITHAKI_V249477_R3_REAL_DEPLOY__={storyBarSingleLoad:true,professionalPasswordRemoved:true,cacheBust:true};
window.__ITHAKI_V249494_CANONICAL_STORY__={normalPreviewOnly:true,feedAfterPublish:true,storyBarAvatar:true};
window.__ITHAKI_V249495_STORY_STUDIO_VIEW__={coreStudio:true,forcePreviewClose:true,normalStoryViewer:true,transparentStoryBar:true};
window.__ITHAKI_V249496_PRO_TABS_CREATOR_NAMES__={subtabsReturnToSelection:true,creatorToolsNamed:true,creatorCenterStaysOpen:true,wallReturnsToSelection:true};
window.__ITHAKI_V249499_RUNTIME_TRUTH__={realStoryAvatarPhotos:true,professionalAdminTile:true,serverAdminInboxVisible:true,ownAvatarRuntimeCapture:true};
window.__ITHAKI_V249478_DIRECT_PRO_CENTER__={legacyPasswordGateBlocked:true,canonicalUrlVersion:true,installedAt:Date.now()};
window.__ITHAKI_BIL_ONLY_NOTIFICATIONS_V249477__=true;
var $=function(id){return document.getElementById(id)}, I=function(){return window.ITH=window.ITH||{}}, S=function(){try{return window.state||I().state||{}}catch(e){return{}}};
var esc=function(v){return String(v==null?'':v).replace(/[&<>"']/g,function(c){return{'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]})};
var lang=function(){try{return String(localStorage.getItem('ith_ui_lang')||localStorage.getItem('ok_ui_language')||document.documentElement.lang||'el').toLowerCase().startsWith('en')?'en':'el'}catch(e){return'el'}};
var tr=function(el,en){return lang()==='en'?en:el};
var room=function(){return String(S().room||localStorage.getItem('ith_room')||'ithaki-phone-test')};
var device=function(){return String(S().device||S().device_id||localStorage.getItem('ith_device')||'')};
var nickname=function(){return String(S().name||localStorage.getItem('ith_name')||tr('Μέλος','Member'))};
var avatar=function(){return String(S().avatar||localStorage.getItem('ith_avatar')||'')};
var apiUrl=function(path){try{return typeof window.api==='function'?window.api(path):path}catch(e){return path}};
var token=function(){return String(S().token||'')};
var toast=function(msg,ms){try{if(typeof window.toast==='function')return window.toast(msg,ms);if(I().toast)return I().toast(msg,ms)}catch(e){}alert(msg)};
var requestId=function(){try{return crypto.randomUUID()}catch(e){return'r477_'+Date.now()+'_'+Math.random().toString(36).slice(2)}};
async function getJ(path){var r=await fetch(apiUrl(path),{cache:'no-store',credentials:'same-origin',headers:token()?{'X-ITHAKI-TOKEN':token()}:undefined}),d={};try{d=await r.json()}catch(e){}if(!r.ok||d.ok===false)throw new Error(d.detail||d.note||('HTTP '+r.status));return d}
async function postJ(path,body){var h={'Content-Type':'application/json'};if(token())h['X-ITHAKI-TOKEN']=token();var r=await fetch(apiUrl(path),{method:'POST',cache:'no-store',credentials:'same-origin',headers:h,body:JSON.stringify(Object.assign({room_id:room(),device_id:device(),request_id:requestId(),client_ts:Date.now()},body||{}))}),d={};try{d=await r.json()}catch(e){}if(!r.ok||d.ok===false)throw new Error((d.detail&&JSON.stringify(d.detail))||d.detail||d.note||('HTTP '+r.status));return d}
function addCss(){if($('ithV249477Css'))return;var s=document.createElement('style');s.id='ithV249477Css';s.textContent=`
#ithBilGreenTurtleV249461,#ithBilMenuV249461,#ithBilPopV249461,#ithBilStableV249475,#ithBilStableMenuV249475,#ithProfileBilCardV249476,#ithAdminContactCardV249476{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}
.ith477Overlay{position:fixed;inset:0;z-index:2147483635;background:rgba(2,10,18,.96);color:#f6fbff;overflow:auto;padding:calc(10px + env(safe-area-inset-top)) 10px calc(90px + env(safe-area-inset-bottom));font-family:system-ui,sans-serif}.ith477Shell{width:min(920px,100%);margin:auto}.ith477Top{position:sticky;top:0;z-index:4;display:flex;align-items:center;gap:9px;padding:8px;background:rgba(5,20,34,.94);backdrop-filter:blur(18px);border:1px solid rgba(145,207,255,.2);border-radius:18px}.ith477Top h2{font-size:17px;margin:0;flex:1}.ith477Back,.ith477Close,.ith477Btn{min-height:43px;border-radius:13px;border:1px solid rgba(161,211,255,.28);background:rgba(22,55,78,.92);color:#fff;font-weight:850;padding:8px 12px}.ith477Close{background:rgba(100,22,29,.8)}.ith477Card{margin:10px 0;padding:13px;border-radius:18px;border:1px solid rgba(150,211,255,.2);background:linear-gradient(145deg,rgba(12,40,58,.94),rgba(4,20,34,.94));box-shadow:0 15px 35px rgba(0,0,0,.25)}.ith477Grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px}.ith477Tile{min-height:105px;text-align:left;border-radius:18px;padding:13px;border:1px solid rgba(255,215,104,.26);background:rgba(12,42,59,.9);color:#fff}.ith477Tile b{display:block;font-size:15px;margin-bottom:5px}.ith477Tile small{opacity:.8}.ith477Label{display:grid;gap:5px;margin:10px 0;font-weight:800}.ith477Label input,.ith477Label textarea,.ith477Label select{width:100%;box-sizing:border-box;min-height:44px;border-radius:13px;border:1px solid rgba(151,211,255,.27);background:#061b2a;color:#fff;padding:10px;font:inherit}.ith477Label textarea{min-height:95px;resize:vertical}.ith477Row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ith477Status{font-size:12px;opacity:.78;white-space:pre-wrap}.ith477Notice{border-color:rgba(255,211,94,.4);background:rgba(82,53,6,.35)}.ith477Danger{background:#6d1820!important}.ith477Green{background:#075b42!important}.ith477BilFace{width:82px;height:70px;position:relative;display:block;margin:auto}.ith477BilFace .shell{position:absolute;left:13px;top:31px;width:56px;height:34px;border-radius:50% 50% 40% 40%;background:radial-gradient(circle at 38% 30%,#e5dc78 0 16%,#4da87b 17% 55%,#195843 56%);border:2px solid rgba(255,255,255,.35)}.ith477BilFace .head{position:absolute;left:29px;top:5px;width:30px;height:31px;border-radius:50%;background:#7bd59b;border:2px solid rgba(255,255,255,.32)}.ith477BilFace .eye{position:absolute;top:9px;width:4px;height:6px;border-radius:50%;background:#10231e}.ith477BilFace .eye.l{left:7px}.ith477BilFace .eye.r{right:7px}.ith477BilFace .mouth{position:absolute;left:10px;top:20px;width:8px;height:4px;border-bottom:2px solid #10231e;border-radius:0 0 9px 9px}.ith477Toggle{display:grid;grid-template-columns:1fr 1fr;gap:8px}.ith477Toggle button.active{outline:2px solid #44e7aa;background:#0b5b45}.ith477StoryBar{display:flex;gap:9px;overflow-x:auto;padding:9px 6px 13px;scrollbar-width:none}.ith477StoryCircle{width:74px;min-width:74px;border:0;background:transparent;color:inherit;text-align:center}.ith477StoryRing{width:64px;height:64px;border-radius:50%;padding:3px;background:linear-gradient(135deg,#ffcc55,#e14b91,#6c65ff);display:block}.ith477StoryRing img,.ith477StoryRing video{width:100%;height:100%;object-fit:cover;border-radius:50%;background:#04131f}.ith477StoryCircle small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ith477StoryViewer{position:fixed;inset:0;z-index:2147483644;background:rgba(0,0,0,.78);display:grid;place-items:center;padding:calc(62px + env(safe-area-inset-top)) 12px calc(62px + env(safe-area-inset-bottom));box-sizing:border-box;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}.ith477StoryMedia{display:block;width:min(92vw,560px);height:auto;max-height:78dvh;object-fit:contain;border-radius:22px;background:#000;box-shadow:0 24px 70px rgba(0,0,0,.58);transform:none!important;zoom:1!important}.ith477StoryBars{position:absolute;top:calc(9px + env(safe-area-inset-top));left:10px;right:10px;display:flex;gap:4px;z-index:4}.ith477StoryBars i{height:3px;flex:1;background:rgba(255,255,255,.32);border-radius:9px;overflow:hidden}.ith477StoryBars i b{display:block;height:100%;width:0;background:#fff}.ith477StoryMeta{position:absolute;top:calc(21px + env(safe-area-inset-top));left:12px;right:12px;z-index:4;display:flex;align-items:center;gap:8px;color:#fff;text-shadow:0 2px 7px #000}.ith477StoryClose{margin-left:auto}.ith477StoryTap{position:absolute;top:0;bottom:0;width:36%;z-index:3;background:transparent;border:0}.ith477StoryTap.prev{left:0}.ith477StoryTap.next{right:0}.ith477StoryCaption{position:absolute;left:12px;right:12px;bottom:calc(22px + env(safe-area-inset-bottom));z-index:4;padding:10px;border-radius:15px;background:rgba(0,0,0,.38);color:#fff;white-space:pre-wrap}.ith477CommentTools{display:flex;gap:6px;padding:6px 0}.ith477CommentTools button{width:42px;height:42px;border-radius:50%;border:1px solid rgba(140,204,255,.3);background:rgba(8,33,51,.92);color:#fff}.commentBubble .messageMedia,.commentBubble video,.commentBubble img,.commentBubble audio{max-width:min(230px,72vw)!important;max-height:180px!important;border-radius:12px!important;object-fit:contain!important}.commentBubble video,.commentBubble audio{display:block!important}.ith477ExternalTabs{display:flex;gap:6px;overflow-x:auto;padding-bottom:7px}.ith477ExternalTabs button.active{background:#0b634a}.ith477Msg{display:grid;gap:6px}.ith477MsgMeta{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.ith477Badge{padding:3px 7px;border-radius:999px;background:#254c65;font-size:11px;font-weight:850}.ith477LocalOnly{color:#68e6b6;font-weight:900}.ith477EscapeArrow{position:absolute!important;top:max(10px,env(safe-area-inset-top))!important;left:10px!important;z-index:2147483642!important;width:46px!important;height:46px!important;border-radius:50%!important;border:1px solid rgba(255,255,255,.35)!important;background:rgba(5,24,38,.88)!important;color:#fff!important;font-size:27px!important;display:grid!important;place-items:center!important}
@media(max-width:600px){.ith477Grid{grid-template-columns:1fr 1fr}.ith477Tile{min-height:94px;padding:10px}.ith477Overlay{padding-left:7px;padding-right:7px}.ith477StoryViewer{padding-left:8px;padding-right:8px}.ith477StoryMedia{width:min(94vw,500px);max-height:76dvh;border-radius:18px}}
`;s.textContent+=' .ith481StoryAvatar{background:rgba(10,22,34,.9);display:grid;place-items:center;font-size:24px;font-weight:800}.ith481StoryAvatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}.ith481ViewerAvatar{width:36px;height:36px;border-radius:50%;overflow:hidden;display:inline-grid;place-items:center;margin-right:9px;vertical-align:middle;background:rgba(255,255,255,.14)}.ith481ViewerAvatar img{width:100%;height:100%;object-fit:cover}';
s.textContent+=`body[data-page="feed"] #ith477StoryBarWrap{display:block!important;visibility:visible!important;opacity:1!important;position:fixed!important;left:10px!important;right:10px!important;top:max(8px,env(safe-area-inset-top))!important;z-index:190!important;max-width:920px!important;margin:0 auto!important;padding:8px 11px!important;border-radius:22px!important;background:rgba(6,18,30,.16)!important;border:1px solid rgba(255,255,255,.12)!important;box-shadow:0 8px 24px rgba(0,0,0,.12)!important;backdrop-filter:blur(14px)!important;-webkit-backdrop-filter:blur(14px)!important}body[data-page="feed"] #ith477StoryBarWrap .ith477Row{display:none!important}body[data-page="feed"] #ith477StoryBarWrap .ith477StoryBar{display:flex!important;gap:12px!important;overflow-x:auto!important;padding:2px!important;scrollbar-width:none!important}body[data-page="feed"] #ith477StoryBarWrap .ith477StoryBar::-webkit-scrollbar{display:none!important}body[data-page="feed"] #ith477StoryBarWrap .ith477StoryCircle{display:block!important;visibility:visible!important;opacity:1!important;filter:none!important;position:relative!important;min-width:72px!important;width:72px!important;padding:0!important;border:0!important;background:transparent!important;color:#fff!important}body[data-page="feed"] #ith477StoryBarWrap .ith477StoryRing,body[data-page="feed"] #ith477StoryBarWrap .ith481StoryAvatar{display:grid!important;place-items:center!important;width:62px!important;height:62px!important;min-width:62px!important;margin:auto!important;border-radius:50%!important;overflow:hidden!important;border:3px solid #ffd16c!important;background:rgba(255,255,255,.18)!important;box-shadow:0 0 0 3px rgba(255,255,255,.12),0 0 20px rgba(255,190,68,.48)!important;filter:none!important;opacity:1!important}body[data-page="feed"] #ith477StoryBarWrap img{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;filter:none!important;opacity:1!important;visibility:visible!important;mix-blend-mode:normal!important;transform:none!important}.ith494StorySelection{margin-top:10px!important}.ith494StorySelectionMedia{width:100%;max-height:48dvh;display:grid;place-items:center;overflow:hidden;border-radius:16px;background:#000;margin-bottom:10px}.ith494StorySelectionMedia img,.ith494StorySelectionMedia video{display:block;max-width:100%;max-height:48dvh;object-fit:contain}.ith494StorySelectionActions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:9px!important}.ith494StorySelectionActions button{width:100%!important;min-height:48px!important}.ith494StoryBadge{position:absolute!important;right:0!important;bottom:14px!important;min-width:29px!important;height:17px!important;padding:0 4px!important;border-radius:99px!important;display:grid!important;place-items:center!important;background:#ff3f72!important;color:#fff!important;border:2px solid #fff!important;font-size:7px!important;font-style:normal!important;font-weight:950!important;letter-spacing:.2px!important;box-shadow:0 3px 9px rgba(0,0,0,.35)!important}body[data-page="feed"] #feedPage{padding-top:88px!important}body .nav{position:fixed!important;left:10px!important;right:10px!important;bottom:max(8px,env(safe-area-inset-bottom))!important;width:auto!important;border-radius:23px!important;overflow:hidden!important;background:linear-gradient(180deg,rgba(17,35,52,.74),rgba(4,14,26,.84))!important;border:1px solid rgba(255,255,255,.15)!important;box-shadow:0 13px 34px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.10)!important;backdrop-filter:blur(18px)!important;-webkit-backdrop-filter:blur(18px)!important;z-index:210!important}@media(max-width:520px){body[data-page="feed"] #ith477StoryBarWrap{left:7px!important;right:7px!important;padding:7px 9px!important}body[data-page="feed"] #ith477StoryBarWrap .ith477StoryCircle{min-width:66px!important;width:66px!important}body[data-page="feed"] #ith477StoryBarWrap .ith477StoryRing,body[data-page="feed"] #ith477StoryBarWrap .ith481StoryAvatar{width:58px!important;height:58px!important;min-width:58px!important}body .nav{left:7px!important;right:7px!important;bottom:max(7px,env(safe-area-inset-bottom))!important}}`;
s.textContent+=`
#feedPage .mediaPost .leftActions .feedAvatarOverlay{display:flex!important;visibility:visible!important;opacity:1!important;filter:none!important;pointer-events:auto!important;position:relative!important;width:52px!important;min-width:52px!important;height:auto!important;min-height:62px!important;padding:3px 2px!important;margin:0 0 2px!important;border:0!important;background:transparent!important;box-shadow:none!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important}
#feedPage .mediaPost .leftActions .feedAvatarOverlay .avatar{display:grid!important;visibility:visible!important;opacity:1!important;width:47px!important;height:47px!important;min-width:47px!important;border:2px solid rgba(255,255,255,.92)!important;background:rgba(255,255,255,.12)!important;box-shadow:0 0 0 3px rgba(255,205,91,.34),0 8px 22px rgba(0,0,0,.44)!important;filter:none!important;overflow:hidden!important}
#feedPage .mediaPost .leftActions .feedAvatarOverlay .avatar img{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;filter:none!important;opacity:1!important;visibility:visible!important;mix-blend-mode:normal!important}
#feedPage .mediaPost .leftActions .feedAvatarOverlay small{display:block!important;max-width:58px!important;color:#fff!important;font-size:9px!important;font-weight:900!important;line-height:1.05!important;text-align:center!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;text-shadow:0 2px 7px #000!important}
.ith497StoryCard{width:104px;min-width:104px;display:grid;gap:5px;position:relative;text-align:center}.ith497StoryOpen{width:100%;border:0;background:transparent;color:#fff;padding:0;position:relative}.ith497StoryThumb{display:block;width:96px;height:126px;border-radius:18px;overflow:hidden;background:rgba(4,17,28,.88);border:2px solid rgba(255,210,104,.74);box-shadow:0 9px 24px rgba(0,0,0,.34);position:relative;margin:auto}.ith497StoryThumb>img,.ith497StoryThumb>video{display:block;width:100%;height:100%;object-fit:cover;filter:none!important;opacity:1!important}.ith497StoryAvatarMini{position:absolute;left:5px;bottom:5px;width:34px;height:34px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:#102638;border:2px solid #fff;box-shadow:0 5px 14px rgba(0,0,0,.45);font-size:17px;font-weight:950}.ith497StoryAvatarMini img{width:100%;height:100%;object-fit:cover}.ith497StoryName{display:block;max-width:100px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px;font-weight:900}.ith497StoryFeedBtn{min-height:30px;border-radius:10px;border:1px solid rgba(142,214,255,.30);background:rgba(13,55,79,.86);color:#fff;font-size:10px;font-weight:900;padding:5px 7px}.ith497StoryRecent{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(14px + env(safe-area-inset-bottom));z-index:6;width:min(94vw,660px);display:flex;gap:8px;overflow-x:auto;padding:8px;border-radius:17px;background:rgba(2,11,20,.56);border:1px solid rgba(255,255,255,.14);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);scrollbar-width:none}.ith497StoryRecent::-webkit-scrollbar{display:none}.ith497StoryPostThumb{width:76px;min-width:76px;height:96px;border-radius:13px;overflow:hidden;border:1px solid rgba(255,214,105,.44);background:rgba(20,45,61,.9);color:#fff;padding:0;position:relative}.ith497StoryPostThumb img,.ith497StoryPostThumb video{width:100%;height:100%;object-fit:cover;display:block}.ith497StoryPostThumb span{position:absolute;left:3px;right:3px;bottom:3px;padding:3px;border-radius:7px;background:rgba(0,0,0,.62);font-size:8px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ith497StoryMemberFeed{position:absolute;right:12px;bottom:calc(126px + env(safe-area-inset-bottom));z-index:7}.ith497AdminSubject{display:grid;grid-template-columns:1fr 160px;gap:8px}.ith497AdminThreadSubject{color:#ffd978;font-weight:900;margin-bottom:5px}.ith497SwipeOpening{animation:ith497SwipeLeft .26s ease both}@keyframes ith497SwipeLeft{from{transform:translateX(0);opacity:1}to{transform:translateX(-22%);opacity:.35}}
body[data-page="feed"] #ith477StoryBarWrap .ith477StoryBar{align-items:flex-start!important;gap:10px!important}body[data-page="feed"] #ith477StoryBarWrap .ith477StoryCircle{width:auto!important;min-width:0!important}.ith477StoryViewer:has(.ith497StoryRecent) .ith477StoryCaption{bottom:calc(126px + env(safe-area-inset-bottom))}
@media(max-width:600px){.ith497StoryCard{width:94px;min-width:94px}.ith497StoryThumb{width:88px;height:116px}.ith497AdminSubject{grid-template-columns:1fr}.ith497StoryMemberFeed{bottom:calc(118px + env(safe-area-inset-bottom))}}

/* V249498: no media thumbnails in feed Story bar; only clear circular avatars. */
body[data-page="feed"] #ith477StoryBarWrap{background:transparent!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;padding:6px 8px!important}
body[data-page="feed"] #ith477StoryBarWrap .ith477StoryBar{gap:12px!important;align-items:flex-start!important;padding:2px 1px!important}
body[data-page="feed"] #ith477StoryBarWrap .ith497StoryCard{width:76px!important;min-width:76px!important;display:block!important}
body[data-page="feed"] #ith477StoryBarWrap .ith497StoryOpen{display:block!important;width:76px!important;min-width:76px!important;padding:0!important;background:transparent!important}
body[data-page="feed"] #ith477StoryBarWrap .ith497StoryThumb,body[data-page="feed"] #ith477StoryBarWrap .ith497StoryFeedBtn{display:none!important}
body[data-page="feed"] #ith477StoryBarWrap .ith477StoryRing{display:grid!important;place-items:center!important;width:64px!important;height:64px!important;min-width:64px!important;margin:0 auto!important;padding:3px!important;border-radius:50%!important;overflow:hidden!important;background:transparent!important;border:3px solid #ffd36a!important;box-shadow:0 0 0 2px rgba(255,255,255,.34),0 0 16px rgba(255,194,71,.38)!important;filter:none!important;opacity:1!important}
body[data-page="feed"] #ith477StoryBarWrap .ith477StoryRing img{display:block!important;width:100%!important;height:100%!important;border-radius:50%!important;object-fit:cover!important;background:transparent!important;filter:none!important;opacity:1!important;visibility:visible!important;mix-blend-mode:normal!important;transform:none!important}
body[data-page="feed"] #ith477StoryBarWrap .ith497StoryName{display:block!important;margin-top:3px!important;color:#fff!important;text-shadow:0 2px 7px rgba(0,0,0,.95)!important}
body[data-page="feed"] #ith477StoryBarWrap .ith494StoryBadge{right:2px!important;bottom:14px!important}

/* V249499 real avatar photo and visible admin contact. */
#ith477StoryBarWrap .ith477StoryRing.ith499StoryAvatar{position:relative!important;display:grid!important;place-items:center!important;background:transparent!important;overflow:hidden!important}
#ith477StoryBarWrap .ith499StoryAvatarFallback{position:absolute!important;inset:0!important;display:grid!important;place-items:center!important;border-radius:50%!important;background:transparent!important;color:#fff!important;font-size:26px!important;font-weight:950!important;text-shadow:0 2px 8px rgba(0,0,0,.75)!important}
#ith477StoryBarWrap .ith499StoryAvatar img{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;padding:0!important;margin:0!important;border-radius:50%!important;object-fit:cover!important;background:transparent!important;filter:none!important;opacity:1!important;visibility:visible!important;mix-blend-mode:normal!important;z-index:2!important}
#ith477StoryBarWrap .ith500StoryAvatar>.avatar{width:100%!important;height:100%!important;border-radius:50%!important;display:grid!important;place-items:center!important;overflow:hidden!important;background:transparent!important;color:#fff!important;font-size:26px!important}#ith477StoryBarWrap .ith500StoryAvatar>.avatar img{display:block!important;width:100%!important;height:100%!important;border-radius:50%!important;object-fit:cover!important;background:transparent!important;filter:none!important;opacity:1!important;visibility:visible!important;mix-blend-mode:normal!important}
#ith499DirectAdminProfile{width:100%!important;margin-top:9px!important;min-height:50px!important;border-radius:16px!important;border:1px solid rgba(255,211,110,.42)!important;background:linear-gradient(145deg,rgba(33,75,99,.96),rgba(8,31,49,.98))!important;color:#fff!important;font-weight:900!important}
`;document.head.appendChild(s)}
function bilFace(){return'<span class="ith477BilFace"><i class="shell"></i><i class="head"><i class="eye l"></i><i class="eye r"></i><i class="mouth"></i></i></span>'}
var OLD_BIL_IDS=['ithBilGreenTurtleV249461','ithBilMenuV249461','ithBilPopV249461','ithBilStableV249475','ithBilStableMenuV249475','ithProfileBilCardV249476','ithAdminContactCardV249476'];
function removeBilOutsideNotifications(){OLD_BIL_IDS.forEach(function(id){var x=$(id);if(x)x.remove()});document.querySelectorAll('#profilePage [data-bil],#profilePage [id*="bil" i],#profilePage [class*="bil" i]').forEach(function(x){if(!x.closest('#notifySettingsV249258'))x.remove()})}
function bilOn(){try{return localStorage.getItem('ith_bil_enabled_v249461')!=='0'}catch(e){return true}}
function setBil(on){try{localStorage.setItem('ith_bil_enabled_v249461',on?'1':'0');localStorage.setItem('ithaki_companion_v249258',on?'bil':'none')}catch(e){}renderBilNotification();return false}
function renderBilNotification(){if(window.__ITHAKI_V249525_NOTIFICATION_OWNER__)return;var host=$('notifySettingsV249258')||$('notificationSettingsV249238')||$('ithNotificationSettingsV249238');if(!host)return;var on=bilOn(),sig=(on?'1':'0')+'|'+lang();var old=$('ith477BilNotificationCard');if(old&&old.parentNode===host&&old.getAttribute('data-render-sig')===sig)return;if(old)old.remove();var d=document.createElement('section');d.id='ith477BilNotificationCard';d.className='card';d.setAttribute('data-render-sig',sig);d.innerHTML='<div class="ith477Row">'+bilFace()+'<div><b>Bil</b><div class="date">'+esc(tr('Ο Bil υπάρχει μόνο μέσα στις Ειδοποιήσεις. Δεν εμφανίζεται στην Αρχική, στο Προφίλ ή στο Επαγγελματικό Κέντρο.','Bil exists only inside Notifications. It is not shown on Home, Profile or the Professional Center.'))+'</div></div></div><div class="ith477Toggle"><button class="ith477Btn '+(on?'active':'')+'" data-bil477="1">'+esc(tr('Ενεργοποιημένος','Enabled'))+'</button><button class="ith477Btn '+(!on?'active':'')+'" data-bil477="0">'+esc(tr('Απενεργοποιημένος','Disabled'))+'</button></div>';d.onclick=function(e){var b=e.target.closest('[data-bil477]');if(b)setBil(b.dataset.bil477==='1')};host.prepend(d)}
function wrapNotifications(){if(window.__ITHAKI_V249525_NOTIFICATION_OWNER__)return;['openNotificationSettingsV249238','notifyCenter','renderNotificationCenter'].forEach(function(k){var fn=I()[k]||window[k];if(typeof fn!=='function'||fn.__v249477)return;var w=function(){var r=fn.apply(this,arguments);setTimeout(renderBilNotification,30);setTimeout(renderBilNotification,250);return r};w.__v249477=true;if(I()[k])I()[k]=w;if(window[k])window[k]=w})}

var proOverlay=null,proToken='';try{proToken=sessionStorage.getItem('ith_pro_session_v249477')||sessionStorage.getItem('ith_pro_session_249383')||''}catch(e){}
var oldProOpen={};
function proPayload(x){return Object.assign({room_id:room(),device_id:device(),client_ts:Date.now(),request_id:requestId(),website:''},x||{})}
async function proStatus(){return getJ('/api/account/v249383/status?room_id='+encodeURIComponent(room())+'&device_id='+encodeURIComponent(device())+'&_v='+Date.now())}
function newOverlay(title,back){closeProOverlay();var d=document.createElement('section');d.id='ithProCenterV249477';d.className='ith477Overlay';d.innerHTML='<div class="ith477Shell"><div class="ith477Top">'+(back?'<button class="ith477Back" id="ith477Back" title="'+esc(tr('Επιστροφή στις επιλογές','Back to choices'))+'">‹ <span>'+esc(tr('Επιλογές','Choices'))+'</span></button>':'')+'<h2>'+esc(title)+'</h2><button class="ith477Close" id="ith477Close">×</button></div><div id="ith477Body"></div></div>';document.body.appendChild(d);proOverlay=d;d.querySelector('#ith477Close').onclick=closeProOverlay;if(back)d.querySelector('#ith477Back').onclick=typeof back==='function'?back:renderProMenu;return d}
function closeProOverlay(){var x=$('ithProCenterV249477');if(x)x.remove();proOverlay=null;return false}
function closeLegacyProfessionalUi(){['ithUnifiedAccountV249383','ithAccountModal383','ithProfessionalModal383','ithProNameMismatchV249476'].forEach(function(id){var x=$(id);if(x)x.remove()});document.querySelectorAll('.ithAccountOverlay383,.ithModal383,[id*="professional" i][class*="modal" i]').forEach(function(x){if(x.id!=='ithProCenterV249477'&&!x.closest('#ithProCenterV249477'))x.remove()})}
function forceDirectProfessionalEntry(){var ith=I();['openProfessionalCenterV249383','openProfessionalCenterV249384','openProfessionalCenterV249386','openProfessionalCenterFastV249392','openProfessionalCenterV249477'].forEach(function(k){ith[k]=openProCenter});var quick=$('ithProQuick384');if(quick){quick.onclick=openProCenter;quick.removeAttribute('data-old-handler')}var b=$('ithOpenProfessional383');if(b){b.onclick=openProCenter;b.textContent=tr('💼 Άνοιγμα Επαγγελματικού Κέντρου','💼 Open Professional Center')}document.querySelectorAll('[onclick*="openProfessionalCenter"],[onclick*="openUnifiedAccount"]').forEach(function(x){x.onclick=openProCenter;x.removeAttribute('onclick')})}
function captureProfessionalEntry(e){var q=e.target&&e.target.closest?e.target.closest('#ithProQuick384,#ithOpenProfessional383,[data-open-professional],[aria-label="Επαγγελματικό Κέντρο"],[title="Επαγγελματικό Κέντρο"]'):null;if(!q)return;e.preventDefault();e.stopImmediatePropagation();openProCenter()}

async function validatePro(){if(!proToken)return false;try{var d=await postJ('/api/account/v249383/professional/session/validate',proPayload({session_token:proToken}));return!!d.ok}catch(e){proToken='';try{sessionStorage.removeItem('ith_pro_session_v249477');sessionStorage.removeItem('ith_pro_session_249383')}catch(_){}return false}}
async function syncProNameWithoutPassword(){try{var st=await proStatus(),cur=nickname().trim();if(st.professional_enabled&&cur&&String(st.account_name||'').trim()!==cur&&proToken){await postJ('/api/account/v249383/professional/profile/update',proPayload({session_token:proToken,account_name:cur,avatar:avatar(),account_mode:'normal'}))}}catch(e){console.warn('V249477 name sync',e)}}
async function openProCenter(){try{closeLegacyProfessionalUi();return renderProMenu()}catch(e){toast(String(e.message||e),7000)}return false}
function renderProMenu(){var d=newOverlay(tr('💼 Επαγγελματικό Κέντρο','💼 Professional Center'),false),b=$('ith477Body');b.innerHTML='<section class="ith477Card"><b>'+esc(nickname())+'</b><div class="ith477Status">'+esc(tr('Άμεση πρόσβαση στο Επαγγελματικό Κέντρο χωρίς κωδικό.','Direct access to the Professional Center without a password.'))+'</div></section><div class="ith477Grid">'+
 tile('stories','⏱️',tr('24ωρα Stories','24-hour Stories'),tr('Φωτογραφία ή βίντεο πάνω από τη Ροή.','Photo or video above Feed.'))+
 tile('external','📨',tr('Κέντρο Εξωτερικών Μηνυμάτων','External Message Center'),tr('Email, Viber και SMS/MMS μόνο στη συσκευή.','Email, Viber and SMS/MMS only on device.'))+
 tile('admin','💬',tr('Άμεση επαφή διαχειριστή','Direct administrator contact'),tr('Στείλε θέμα και μήνυμα· η απάντηση εμφανίζεται εδώ.','Send a subject and message; the reply appears here.'))+
 tile('calendar','📅',tr('Επαγγελματικό ημερολόγιο','Professional calendar'),tr('Τοπικές υπενθυμίσεις και εργασίες.','Local reminders and tasks.'))+
 tile('security','🛡️',tr('Ανωνυμία και κρυπτογράφηση','Anonymity and encryption'),tr('Ρυθμίσεις ασφαλείας και ιδιωτικότητας.','Security and privacy settings.'))+
 tile('wall','🕊️',tr('Ανώνυμος Τοίχος','Anonymous Wall'),tr('Άνοιγμα με εμφανές βελάκι διαφυγής.','Open with a visible escape arrow.'))+
 tile('creator','📊',tr('Εργαλεία δημιουργού','Creator tools'),tr('Προβολές, στατιστικά και ποιότητα.','Views, statistics and quality.'))+
 '</div>';b.onclick=function(e){var q=e.target.closest('[data-pro477]');if(q)openProTab(q.dataset.pro477)};return false}
function tile(k,icon,title,sub){return'<button class="ith477Tile" data-pro477="'+k+'"><b>'+icon+' '+esc(title)+'</b><small>'+esc(sub)+'</small></button>'}
function openProTab(k){if(k==='stories')return renderStoriesTab();if(k==='external')return openExternalCenter(true);if(k==='admin')return renderAdminTab();if(k==='calendar')return openExternalCenter(true,'calendar');if(k==='security')return renderSecurityTab();if(k==='wall')return openAnonymousWall();if(k==='creator')return renderCreatorTools()}
function tabBody(title,back){newOverlay(title,back||renderProMenu);return $('ith477Body')}
function renderCreatorTools(){var b=tabBody(tr('Εργαλεία δημιουργού','Creator tools'),renderProMenu),tools=[['openCreatorViewsV249405','👁️',tr('Πραγματικές προβολές','Real views'),tr('Μοναδικοί θεατές, χρόνος θέασης και ολοκληρώσεις.','Unique viewers, watch time and completions.')],['openCreatorStatsV249406','📊',tr('Στατιστικά βίντεο','Video statistics'),tr('Απόδοση και στοιχεία ανά βίντεο.','Performance and details for each video.')],['openCreatorQualityV249407','🌿',tr('Ποιότητα θέασης','Viewing quality'),tr('Προσεκτική θέαση και φυσικές επαναλήψεις.','Attentive viewing and natural replays.')],['openCreatorSharesV249408','🔗',tr('Κοινοποιήσεις μηνυμάτων','Message shares'),tr('Επιτυχημένες ιδιωτικές κοινοποιήσεις.','Successful private shares.')],['openCreatorBestTimeV249409','🕰️',tr('Καλύτερη ώρα δημοσίευσης','Best publishing time'),tr('Πρόταση ώρας από πραγματική δραστηριότητα.','Timing suggestion from real activity.')],['openCreatorSchedulesV249410','🗓️',tr('Προγραμματισμένες δημοσιεύσεις','Scheduled posts'),tr('Ημερομηνία και ώρα για την επόμενη δημοσίευση.','Date and time for the next post.')]];b.innerHTML='<section class="ith477Card"><b>'+esc(tr('Επίλεξε εργαλείο','Choose a tool'))+'</b><div class="ith477Status">'+esc(tr('Κάθε εργαλείο ανοίγει πάνω από το Κέντρο. Με πίσω ή κλείσιμο επιστρέφεις εδώ.','Each tool opens above the Center. Back or close returns here.'))+'</div></section><div class="ith477Grid">'+tools.map(function(x){return'<button class="ith477Tile" data-f="'+x[0]+'"><b>'+x[1]+' '+esc(x[2])+'</b><small>'+esc(x[3])+'</small></button>'}).join('')+'</div>';b.onclick=function(e){var q=e.target.closest('[data-f]');if(!q)return;var f=I()[q.dataset.f]||window[q.dataset.f];if(typeof f==='function'){window.__ITHAKI_PRO_CREATOR_TOOL_ACTIVE_V249496__=q.dataset.f;f();setTimeout(function(){var panel=$('creatorAnalyticsPanel410');if(panel){panel.setAttribute('data-return-to','professional-creator-tools-v249496');var back=panel.querySelector('.ca410Top button');if(back)back.title=tr('Επιστροφή στα Εργαλεία Δημιουργού','Back to Creator tools')}},30)}else toast(tr('Το εργαλείο δεν είναι διαθέσιμο.','Tool is unavailable.'))}}
function renderSecurityTab(){var b=tabBody(tr('Ανωνυμία και κρυπτογράφηση','Anonymity and encryption'));b.innerHTML='<section class="ith477Card"><b>🕶️ '+esc(tr('Ανωνυμία','Anonymity'))+'</b><p>'+esc(tr('Η ανώνυμη δημοσίευση κρύβει το εμφανιζόμενο όνομα από τη δημοσίευση. Δεν χρησιμοποιείται για παράκαμψη κανόνων ασφάλειας.','Anonymous publishing hides the displayed name from the post. It is not used to bypass safety rules.'))+'</p></section><section class="ith477Card"><b>🔐 '+esc(tr('Κρυπτογράφηση μηνυμάτων','Message encryption'))+'</b><p>'+esc(tr('Οι επιλογές Κανονική AES και πλήρης E2EE παραμένουν στις ρυθμίσεις της συνομιλίας. Τα εξωτερικά μηνύματα αποθηκεύονται κρυπτογραφημένα μόνο στη συσκευή.','Standard AES and full E2EE remain in conversation settings. External messages are encrypted and stored only on device.'))+'</p><button class="ith477Btn" id="ith477OpenEncryption">'+esc(tr('Άνοιγμα ρυθμίσεων κρυπτογράφησης','Open encryption settings'))+'</button></section>';$('ith477OpenEncryption').onclick=function(){var f=I().openEncryptionChoiceV249429||I().openE2EPanel;if(typeof f==='function'){f()}}}

async function renderAdminTab(){var b=tabBody(tr('Άμεση επαφή με διαχειριστή','Direct administrator contact'));b.innerHTML='<section class="ith477Card"><div class="ith477LocalOnly" style="color:#ffd36e">'+esc(tr('Το θέμα και το μήνυμα εμφανίζονται στο ειδικό inbox του προγράμματος server. Η απάντηση του διαχειριστή επιστρέφει στο ίδιο σημείο.','The subject and message appear in the dedicated server-program inbox. The administrator reply returns here.'))+'</div><div class="ith497AdminSubject"><label class="ith477Label">'+esc(tr('Θέμα','Subject'))+'<input id="ith477AdminSubject" maxlength="160" placeholder="'+esc(tr('π.χ. Τεχνικό πρόβλημα','e.g. Technical issue'))+'"></label><label class="ith477Label">'+esc(tr('Κατηγορία','Category'))+'<select id="ith477AdminKind"><option value="technical">'+esc(tr('Τεχνικό','Technical'))+'</option><option value="account">'+esc(tr('Λογαριασμός','Account'))+'</option><option value="professional">'+esc(tr('Επαγγελματικό','Professional'))+'</option><option value="safety">'+esc(tr('Ασφάλεια','Safety'))+'</option><option value="other">'+esc(tr('Άλλο','Other'))+'</option></select></label></div><label class="ith477Label">'+esc(tr('Μήνυμα','Message'))+'<textarea id="ith477AdminText" placeholder="'+esc(tr('Γράψε καθαρά τι χρειάζεσαι…','Clearly describe what you need…'))+'"></textarea></label><div class="ith477Row"><button id="ith477AdminSend" class="ith477Btn ith477Green">'+esc(tr('Αποστολή στον διαχειριστή','Send to administrator'))+'</button><button id="ith499AdminInboxOpen" class="ith477Btn">🖥️ '+esc(tr('Inbox διαχειριστή','Administrator inbox'))+'</button></div></section><div id="ith477AdminThread"></div>';$('ith477AdminSend').onclick=async function(){var t=$('ith477AdminText').value.trim(),subject=$('ith477AdminSubject').value.trim(),kind=$('ith477AdminKind').value||'professional';if(!t)return toast(tr('Γράψε πρώτα μήνυμα.','Write a message first.'));this.disabled=true;try{await postJ('/api/feedback/send',{nickname:nickname(),screen:'professional-center-v249499',subject:subject||tr('Άμεση επαφή','Direct contact'),contact_kind:kind,message:t,user_agent:navigator.userAgent||'',professional_member:true});$('ith477AdminText').value='';$('ith477AdminSubject').value='';toast(tr('Το μήνυμα στάλθηκε στον διαχειριστή.','Message sent to the administrator.'));await loadAdminThread()}catch(e){toast(String(e.message||e),7000)}finally{this.disabled=false}};var ib=$('ith499AdminInboxOpen');if(ib)ib.onclick=function(){var u=apiUrl('/server-admin/professional-contact-v249499');try{window.open(u,'_blank')}catch(e){location.href=u}};await loadAdminThread()}
async function loadAdminThread(){var h=$('ith477AdminThread');if(!h)return;h.innerHTML='<section class="ith477Card">'+esc(tr('Φόρτωση…','Loading…'))+'</section>';try{var d=await getJ('/api/feedback/status?room_id='+encodeURIComponent(room())+'&device_id='+encodeURIComponent(device())+'&limit=100&_v='+Date.now());h.innerHTML=(d.feedback||[]).map(function(x){return'<section class="ith477Card"><div class="ith477Row"><b>'+esc(x.nickname||nickname())+'</b><span class="ith477Badge">💼 '+esc(tr('Επαγγελματικό μέλος','Professional member'))+'</span><span class="ith477Badge">'+esc(String(x.contact_kind||'professional').toUpperCase())+'</span></div><div class="ith497AdminThreadSubject">'+esc(x.subject||tr('Άμεση επαφή','Direct contact'))+'</div><p>'+esc(x.message||'')+'</p>'+(x.admin_reply?'<div class="ith477Card"><b>'+esc(tr('Απάντηση διαχειριστή','Administrator reply'))+'</b><p>'+esc(x.admin_reply)+'</p></div>':'<div class="ith477Status">'+esc(tr('Αναμονή απάντησης','Waiting for reply'))+'</div>')+'</section>'}).join('')||'<section class="ith477Card">'+esc(tr('Δεν υπάρχουν μηνύματα.','No messages.'))+'</section>'}catch(e){h.innerHTML='<section class="ith477Card">'+esc(String(e.message||e))+'</section>'}}

var pendingStoryFileV249494=null,pendingStoryUrlV249494='';
function clearStorySelectionV249494(resetInput){var card=$('ith477StorySelectionV249494');if(card)card.remove();if(pendingStoryUrlV249494){try{URL.revokeObjectURL(pendingStoryUrlV249494)}catch(e){}pendingStoryUrlV249494=''}pendingStoryFileV249494=null;if(resetInput!==false){var input=$('ith477StoryFile');if(input)input.value=''}}
function renderStorySelectionV249494(file){clearStorySelectionV249494(false);if(!file)return false;pendingStoryFileV249494=file;pendingStoryUrlV249494=URL.createObjectURL(file);var status=$('ith477StoryStatus'),host=status&&status.parentNode?status.parentNode:$('ith477Body'),isVideo=String(file.type||'').startsWith('video/'),card=document.createElement('section');card.id='ith477StorySelectionV249494';card.className='ith477Card ith494StorySelection';card.innerHTML='<div class="ith494StorySelectionMedia">'+(isVideo?'<video controls playsinline preload="metadata" src="'+esc(pendingStoryUrlV249494)+'"></video>':'<img src="'+esc(pendingStoryUrlV249494)+'" alt="Story">')+'</div><div class="ith477Row ith494StorySelectionActions"><button type="button" class="ith477Btn ith477Green" id="ith494StoryPreviewBtn">'+esc(tr('Στην κανονική Προεπισκόπηση','Open normal Preview'))+'</button><button type="button" class="ith477Btn ith477Danger" id="ith494StoryCancelBtn">'+esc(tr('Ακύρωση','Cancel'))+'</button></div><div class="ith477Status">'+esc(file.name||tr('Αρχείο Story','Story file'))+'</div>';host.appendChild(card);if(status)status.textContent=tr('Το αρχείο είναι έτοιμο. Πάτησε «Στην κανονική Προεπισκόπηση».','The file is ready. Tap Open normal Preview.');$('ith494StoryPreviewBtn').onclick=function(e){e.preventDefault();e.stopPropagation();return openStoryStudioPreviewV249482(file)};$('ith494StoryCancelBtn').onclick=function(e){e.preventDefault();e.stopPropagation();clearStorySelectionV249494(true);if(status)status.textContent=''};return false}
async function renderStoriesTab(){var b=tabBody(tr('24ωρα Stories','24-hour Stories'));b.innerHTML='<section class="ith477Card"><p>'+esc(tr('Επίλεξε φωτογραφία ή βίντεο και άνοιξέ το στην ίδια κανονική Προεπισκόπηση που χρησιμοποιούν οι δημοσιεύσεις και τα μηνύματα. Το Studio ανοίγει μόνο όταν το πατήσεις εσύ.','Choose a photo or video and open it in the same normal Preview used by posts and messages. Studio opens only when you tap it.'))+'</p><label class="ith477Label">'+esc(tr('Φωτογραφία ή βίντεο','Photo or video'))+'<input id="ith477StoryFile" type="file" accept="image/*,video/*"></label><div id="ith477StoryStatus" class="ith477Status"></div></section><div id="ith477OwnStories"></div>';var inp=$('ith477StoryFile');inp.onchange=function(){var file=inp.files&&inp.files[0];return renderStorySelectionV249494(file)};await loadOwnStories()}
function openStoryStudioPreviewV249482(file){file=file||pendingStoryFileV249494;var status=$('ith477StoryStatus');if(!file){if(status)status.textContent=tr('Δεν έχει επιλεγεί αρχείο Story.','No Story file selected.');return false}if(status)status.textContent=tr('Άνοιγμα κανονικής Προεπισκόπησης…','Opening normal Preview…');var ith=I(),open=ith.openPreview||window.openPreview||window.__ITHAKI_CORE_OPEN_PREVIEW__;if(typeof open!=='function'){if(status)status.textContent=tr('Η κανονική Προεπισκόπηση δεν βρέθηκε.','Normal Preview was not found.');return false}clearStorySelectionV249494(false);closeProOverlay();setTimeout(function(){try{open('story',file,String(file.type||'').startsWith('video/')?'video':'photo','professional-story-v249494')}catch(e){toast(String(e.message||e),7000);return}setTimeout(function(){var st=window.state||ith.state||{};st.preview=st.preview||{};st.preview.ctx='story';st.preview.file=file;st.preview.originalFile=st.preview.originalFile||file;st.preview.target='professional-story-v249494';var send=$('previewSend');if(send){send.disabled=false;send.onclick=function(ev){if(ev){ev.preventDefault();ev.stopPropagation()}return publishStoryFromPreviewV249482()};send.textContent=tr('Δημοσίευση Story 24 ωρών','Publish 24-hour Story')}var modal=$('previewModal');if(modal){modal.style.display='flex';modal.classList.add('show');modal.scrollTop=0}},60)},40);return false}
function forceCloseStoryPreviewV249495(){try{var st=window.state||I().state||{};st.sending=false;st.preview={};window.state=st;I().state=st}catch(e){}try{window.__ITHAKI_PREVIEW_FILE_V249429__=null}catch(e){}try{var modal=$('previewModal');if(modal){modal.classList.remove('show','fullscreen','callCompactV249218','voiceCallV249218','videoCallV249218');modal.style.setProperty('display','none','important');modal.style.setProperty('visibility','hidden','important');modal.style.setProperty('opacity','0','important');modal.innerHTML='';setTimeout(function(){try{if(!modal.classList.contains('show')){modal.style.removeProperty('display');modal.style.removeProperty('visibility');modal.style.removeProperty('opacity')}}catch(e){}},520)}}catch(e){}try{document.body.classList.remove('ithPreviewOpenV249405');document.documentElement.removeAttribute('data-ithaki-preview-v249429')}catch(e){}return false}
async function publishStoryFromPreviewV249482(){var st=window.state||I().state||{},p=st.preview||{},file=p.file||p.originalFile,status=$('progressText'),btn=$('previewSend');if(!file)return false;if(btn){btn.disabled=true;btn.textContent=tr('Ανέβασμα Story…','Uploading Story…')}if(status)status.textContent=tr('Μεταφόρτωση Story…','Uploading Story…');try{var fd=new FormData();fd.append('room_id',room());fd.append('device_id',device());fd.append('media_kind',String(file.type||'').startsWith('video/')?'video':'photo');fd.append('file',file,file.name);var h={};if(token())h['X-ITHAKI-TOKEN']=token();var r=await fetch(apiUrl('/api/media/upload'),{method:'POST',headers:h,body:fd,credentials:'same-origin'}),up=await r.json();if(!r.ok||up.ok===false)throw new Error(up.detail||up.message||('HTTP '+r.status));if(status)status.textContent=tr('Δημιουργία Story…','Creating Story…');var made=await postJ('/api/professional/stories/v249477/create',{nickname:nickname(),avatar:avatar(),media_url:up.url||up.file_url,media_kind:up.kind||up.media_kind||(String(file.type||'').startsWith('video/')?'video':'photo'),mime_type:up.mime_type||file.type,filename:up.filename||file.name,caption:String(($('previewCaption')||{}).value||'').trim()});var story=(made&&made.story)||(made&&made.data)||made||{};if(!story.media_url)story=Object.assign({},story,{device_id:device(),nickname:nickname(),avatar:avatar(),media_url:up.url||up.file_url,media_kind:up.kind||up.media_kind||(String(file.type||'').startsWith('video/')?'video':'photo'),mime_type:up.mime_type||file.type,filename:up.filename||file.name,caption:String(($('previewCaption')||{}).value||'').trim()});forceCloseStoryPreviewV249495();closeProOverlay();await routeStoryToFeedV249494(story);setTimeout(forceCloseStoryPreviewV249495,60);setTimeout(forceCloseStoryPreviewV249495,260);try{window.dispatchEvent(new CustomEvent('ithaki:story-published',{detail:{story:story,version:'V249498'}}))}catch(e){}return false}catch(e){if(status)status.textContent=String(e.message||e);if(btn){btn.disabled=false;btn.textContent=tr('Δημοσίευση Story 24 ωρών','Publish 24-hour Story')}return false}}
async function loadOwnStories(){var h=$('ith477OwnStories');if(!h)return;try{var d=await getJ('/api/professional/stories/v249477/list?room_id='+encodeURIComponent(room())+'&_v='+Date.now()),mine=(d.stories||[]).filter(function(x){return String(x.device_id)===device()});h.innerHTML=mine.map(function(x,i){var u=storyAssetUrlV249499(x.media_url),video=String(x.mime_type||'').startsWith('video/')||String(x.media_kind||'').includes('video');return'<section class="ith477Card" data-own-story-card="'+i+'"><div class="ith477Row"><span class="ith497StoryThumb" style="width:74px;height:92px;margin:0">'+(video?'<video muted playsinline preload="metadata" src="'+esc(u)+'"></video>':'<img src="'+esc(u)+'" loading="lazy">')+'</span><div style="flex:1"><b>'+esc(x.caption||x.filename||tr('Story','Story'))+'</b><div class="ith477Status">'+Math.max(0,Math.ceil(Number(x.remaining_seconds||0)/3600))+'h</div></div></div><div class="ith477Row"><button class="ith477Btn" data-open-ownstory="'+i+'">'+esc(tr('Προβολή Story','View Story'))+'</button><button class="ith477Btn" data-ownstory-feed="'+i+'">'+esc(tr('Δημοσιεύσεις στη Ροή','Posts in Feed'))+'</button><button class="ith477Btn ith477Danger" data-delstory="'+esc(x.story_id)+'">'+esc(tr('Διαγραφή','Delete'))+'</button></div></section>'}).join('')||'<section class="ith477Card">'+esc(tr('Δεν υπάρχουν ενεργά Stories.','No active Stories.'))+'</section>';h.onclick=async function(e){var q=e.target.closest('[data-delstory],[data-open-ownstory],[data-ownstory-feed]');if(!q)return;if(q.hasAttribute('data-delstory')){await postJ('/api/professional/stories/v249477/delete',{story_id:q.dataset.delstory});await loadOwnStories();await loadStoryBar(true);return}var idx=Number(q.dataset.openOwnstory||q.dataset.ownstoryFeed||0),x=mine[idx];if(!x)return;if(q.hasAttribute('data-open-ownstory')){stories=mine;openStory(idx);return}openStoryMemberFeedV249497(x)}}catch(e){h.innerHTML='<section class="ith477Card">'+esc(String(e.message||e))+'</section>'}}

var stories=[],storyIndex=0,storyTimer=0,storyStart=0,storyDuration=7000,storyPaused=false,lastStoryBarAttemptV249494=0;
function ensureAvatarTruthV249502(){if($('ithAvatarTruthCss249502'))return;var st=document.createElement('style');st.id='ithAvatarTruthCss249502';st.textContent=`
#ith477StoryBarWrap,#ith477StoryBarWrap.ith477Card,#ith477StoryBarWrap .ith477StoryBar,#ith477StoryBarWrap .ith497StoryCard,#ith477StoryBarWrap .ith497StoryOpen{background:transparent!important;background-image:none!important;box-shadow:none!important;filter:none!important;opacity:1!important}
#ith477StoryBarWrap .ith477StoryRing,#ith477StoryBarWrap .ith500StoryAvatar,#ith477StoryBarWrap .avatar,#ith477StoryViewer .ith481ViewerAvatar{background:transparent!important;background-image:none!important;filter:none!important;opacity:1!important;visibility:visible!important;mix-blend-mode:normal!important}
#ith477StoryBarWrap img,#ith477StoryViewer .ith481ViewerAvatar img{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;object-position:center!important;border-radius:50%!important;background:transparent!important;filter:none!important;opacity:1!important;visibility:visible!important;mix-blend-mode:normal!important}
#ith477StoryBarWrap .ith477StoryRing::before,#ith477StoryBarWrap .ith477StoryRing::after,#ith477StoryBarWrap .ith500StoryAvatar::before,#ith477StoryBarWrap .ith500StoryAvatar::after{background:transparent!important;filter:none!important;opacity:1!important}
`;document.head.appendChild(st)}
function storyPeopleV249502(){var s=S(),out=[];try{if(s.people&&typeof s.people.values==='function')out=Array.from(s.people.values());else if(Array.isArray(s.people))out=s.people.slice()}catch(e){}return out.filter(Boolean)}
function sameStoryPersonV249502(q,id,nm){var qid=String(q&&q.device_id||q&&q.id||q&&q.member_id||''),qn=String(q&&q.nickname||q&&q.name||'').trim().toLowerCase();return !!((id&&qid===id)||(nm&&qn&&qn===nm))}
function storyAssetUrlV249499(value){var v=String(value||'').trim();if(!v)return'';try{if(v.charAt(0)==='{'){var o=JSON.parse(v);v=String(o.url||o.avatar||o.src||o.path||'').trim()}}catch(e){}if(!v)return'';if(/^(data:|blob:|https?:|file:)/i.test(v))return v;if(v.charAt(0)==='/')return apiUrl(v);if(/^(uploads?|media|files?|assets?)\//i.test(v))return apiUrl('/'+v.replace(/^\/+/,''));if(/\.(png|jpe?g|webp|gif|svg)(\?|#|$)/i.test(v))return apiUrl('/'+v.replace(/^\/+/,''));return''}
function storyAvatarTextV249499(value,nick){var v=String(value||'').trim();if(v&&!storyAssetUrlV249499(v)&&v.length<=12)return v;return String((nick||tr('Μέλος','Member')).trim().slice(0,1)||'👤')}
function storyKeyV249494(x){return String((x&&(x.story_id||x.id))||((x&&x.device_id)||'')+'|'+((x&&x.media_url)||''))}
function storyMediaThumbV249497(x){var u=storyAssetUrlV249499(x.media_url||''),video=String(x.mime_type||'').startsWith('video/')||String(x.media_kind||'').includes('video');if(!u)return'<span style="display:grid;place-items:center;width:100%;height:100%;font-size:30px">ST</span>';return video?'<video muted playsinline preload="metadata" src="'+esc(u)+'"></video>':'<img src="'+esc(u)+'" loading="lazy">'}
function storyAvatarMiniV249497(x){var av=storyAssetUrlV249499(x.avatar||''),fallback=String((x.nickname||tr('Μέλος','Member')).trim().slice(0,1)||'👤');return'<span class="ith497StoryAvatarMini">'+(av?'<img src="'+esc(av)+'" loading="lazy">':esc(fallback))+'</span>'}
function storyPersonV249500(x){var id=String(x&&x.device_id||x&&x.id||''),nm=String(x&&x.nickname||x&&x.name||'').trim().toLowerCase(),s=S(),p={};try{var people=storyPeopleV249502();p=people.find(function(q){return sameStoryPersonV249502(q,id,nm)})||{};if(!Object.keys(p).length&&s.people&&typeof s.people.get==='function')p=s.people.get(id)||{}}catch(e){}var meId=String(s.device||s.device_id||device()),meName=String(s.name||s.nickname||nickname()).trim().toLowerCase();if((id&&id===meId)||(nm&&meName&&nm===meName))p=Object.assign({},p,{avatar:s.avatar||localStorage.getItem('ith_avatar')||p.avatar||p.photo||'',photo:s.avatar||localStorage.getItem('ith_avatar')||p.photo||p.avatar||'',nickname:s.name||s.nickname||p.nickname||nickname()});var rawAvatar=p.avatar||p.photo||x&&x.avatar||x&&x.photo||'';return Object.assign({},x||{},p,{id:id||p.id||p.device_id||'',device_id:id||p.device_id||p.id||'',avatar:rawAvatar,photo:p.photo||p.avatar||x&&x.photo||x&&x.avatar||'',nickname:p.nickname||p.name||x&&x.nickname||x&&x.name||tr('Μέλος','Member')})}
function storyAvatarCircleV249499(x){var p=storyPersonV249500(x),html='';try{var f=window.avatarHtml||I().avatarHtml;if(typeof f==='function')html=f(p)}catch(e){}if(!html){var raw=String(p.avatar||''),av=storyAssetUrlV249499(raw),fallback=storyAvatarTextV249499(raw,p.nickname);html=av?'<span class="avatar"><img src="'+esc(av)+'" loading="lazy" alt=""></span>':'<span class="avatar">'+esc(fallback)+'</span>'}return '<span class="ith477StoryRing ith500StoryAvatar">'+html+'</span>'}
function openStoryMemberFeedV249497(x,postId){stopStory();var f=I().openMemberFeed||window.openMemberFeed;if(typeof f==='function')return f(String(x&&x.device_id||''),String(postId||x&&x.feed_post_id||''));return false}
function renderStoryBarV249494(list){ensureAvatarTruthV249502();var feed=$('feedPage');if(!feed)return false;stories=(list||[]).filter(Boolean);var existing=$('ith477StoryBarWrap');if(existing)existing.remove();if(!stories.length)return false;var wrap=document.createElement('section');wrap.id='ith477StoryBarWrap';wrap.className='ith477Card';wrap.innerHTML='<div class="ith477Row"><b>'+esc(tr('Stories','Stories'))+'</b><small>'+stories.length+'</small></div><div class="ith477StoryBar">'+stories.map(function(x,i){return '<div class="ith497StoryCard"><button class="ith497StoryOpen" data-story="'+i+'" data-story-id="'+esc(storyKeyV249494(x))+'">'+storyAvatarCircleV249499(x)+'<em class="ith494StoryBadge">STORY</em><small class="ith497StoryName">'+esc(storyPersonV249500(x).nickname||tr('Μέλος','Member'))+'</small></button></div>'}).join('')+'</div>';wrap.onclick=function(e){var q=e.target.closest('[data-story]');if(!q)return;var i=Number(q.dataset.story||0),x=stories[i];if(!x)return;openStory(i)};feed.prepend(wrap);return true}
async function loadStoryBar(force,preferred){var feed=$('feedPage');if(!feed)return false;var existing=$('ith477StoryBarWrap');if(existing&&!force)return true;try{var d=await getJ('/api/professional/stories/v249477/list?room_id='+encodeURIComponent(room())+'&_v='+Date.now()),list=d.stories||[];if(preferred){var key=storyKeyV249494(preferred);list=[preferred].concat(list.filter(function(x){return storyKeyV249494(x)!==key}))}return renderStoryBarV249494(list)}catch(e){console.warn('stories v249494',e);if(preferred)return renderStoryBarV249494([preferred]);return false}}
async function routeStoryToFeedV249494(story){var ith=I(),feed=$('feedPage');try{window.__ITHAKI_MEMBER_FEED_MODE_V249483__=false;window.__ITHAKI_MEMBER_FEED_MODE_V249481__=false;document.body.classList.remove('memberFeedV249485')}catch(e){}try{if(typeof ith.showFeedOnly==='function')ith.showFeedOnly();else if(typeof ith.page==='function')ith.page('feed')}catch(e){}try{var st=window.state||ith.state||{};st.page='feed';window.state=st;ith.state=st;document.body.setAttribute('data-page','feed');document.querySelectorAll('.page').forEach(function(x){x.classList.remove('active')});feed=$('feedPage');if(feed)feed.classList.add('active');document.querySelectorAll('.nav button').forEach(function(b){b.classList.toggle('active',b.dataset.page==='feed')})}catch(e){}try{if(typeof ith.loadFeed==='function')await ith.loadFeed()}catch(e){console.warn('V249494 feed load after story',e)}await loadStoryBar(true,story);for(var i=0;i<5;i++){await new Promise(function(resolve){setTimeout(resolve,i===0?100:180)});try{if(document.body.getAttribute('data-page')!=='feed'&&typeof ith.showFeedOnly==='function')ith.showFeedOnly();feed=$('feedPage');if(feed&&!feed.classList.contains('active')){document.querySelectorAll('.page').forEach(function(x){x.classList.remove('active')});feed.classList.add('active')}await loadStoryBar(true,story);var bar=$('ith477StoryBarWrap');if(bar){bar.style.display='block';bar.style.visibility='visible';bar.style.opacity='1';if(i===0){var list=feed&&feed.querySelector('.feedList');if(list)list.scrollTop=0;window.scrollTo(0,0)}}}catch(e){}}try{window.dispatchEvent(new CustomEvent('ithaki:page-changed',{detail:{page:'feed',source:'story-v249500'}}))}catch(e){}try{var u=new URL(location.href);u.searchParams.set('page','feed');var id=storyKeyV249494(story);if(id)u.searchParams.set('story',id);history.replaceState(null,'',u.pathname+'?'+u.searchParams.toString()+u.hash)}catch(e){}return false}
function stopStory(){clearInterval(storyTimer);storyTimer=0;var v=$('ith477StoryViewer');if(v){v.querySelectorAll('video,audio').forEach(function(m){try{m.pause();m.muted=true;m.currentTime=0}catch(e){}});v.remove()}storyPaused=false}
function storyPostThumbV249497(p){var u=storyAssetUrlV249499(p.thumbnail_url||''),video=String(p.mime_type||'').startsWith('video/')||String(p.kind||'').includes('video'),label=p.caption||p.kind||tr('Δημοσίευση','Post');return'<button class="ith497StoryPostThumb" data-story-post="'+esc(p.post_id||'')+'">'+(u?(video?'<video muted playsinline preload="metadata" src="'+esc(u)+'"></video>':'<img src="'+esc(u)+'" loading="lazy">'):'<span style="position:static;display:grid;place-items:center;height:100%;font-size:22px">📝</span>')+'<span>'+esc(label)+'</span></button>'}
function openStory(i){ensureAvatarTruthV249502();if(!stories.length)return;stopStory();storyIndex=(i+stories.length)%stories.length;var x=stories[storyIndex],v=document.createElement('section');v.id='ith477StoryViewer';v.className='ith477StoryViewer';var isVideo=String(x.media_kind||'').includes('video')||String(x.mime_type||'').startsWith('video/'),media=isVideo?'<video id="ith477StoryMedia" class="ith477StoryMedia" src="'+esc(storyAssetUrlV249499(x.media_url))+'" playsinline autoplay></video>':'<img id="ith477StoryMedia" class="ith477StoryMedia" src="'+esc(storyAssetUrlV249499(x.media_url))+'">';var sp=storyPersonV249500(x),av=storyAssetUrlV249499(sp.avatar||sp.photo||''),nm=esc(sp.nickname||tr('Επαγγελματικό μέλος','Professional member')),avh=av?'<span class="ith481ViewerAvatar"><img src="'+esc(av)+'"></span>':'<span class="ith481ViewerAvatar">'+esc(String((x.nickname||'Μ').slice(0,1)))+'</span>',recent=Array.isArray(x.recent_posts)?x.recent_posts.slice(0,6):[],tray=recent.length?'<div class="ith497StoryRecent">'+recent.map(storyPostThumbV249497).join('')+'</div>':'';v.innerHTML='<div class="ith477StoryBars">'+stories.map(function(_,j){return'<i><b id="ith477Bar'+j+'" style="width:'+(j<storyIndex?'100':'0')+'%"></b></i>'}).join('')+'</div><div class="ith477StoryMeta"><b>'+avh+nm+'</b><button class="ith477Btn ith477StoryClose">×</button></div>'+media+'<button class="ith477StoryTap prev"></button><button class="ith477StoryTap next"></button><button class="ith477Btn ith497StoryMemberFeed" data-story-member-feed>↗ '+esc(tr('Δημοσιεύσεις στη Ροή','Posts in Feed'))+'</button>'+(x.caption?'<div class="ith477StoryCaption">'+esc(x.caption)+'</div>':'')+tray;document.body.appendChild(v);v.querySelector('.ith477StoryClose').onclick=stopStory;v.querySelector('.prev').onclick=function(){openStory(storyIndex-1)};v.querySelector('.next').onclick=function(){openStory(storyIndex+1)};v.querySelector('[data-story-member-feed]').onclick=function(e){e.preventDefault();e.stopPropagation();openStoryMemberFeedV249497(x)};v.querySelectorAll('[data-story-post]').forEach(function(b){b.onclick=function(e){e.preventDefault();e.stopPropagation();openStoryMemberFeedV249497(x,b.dataset.storyPost)}});var m=$('ith477StoryMedia');storyDuration=isVideo?Math.max(3000,Math.min(30000,Number(m.duration||0)*1000||15000)):7000;storyStart=Date.now();if(isVideo){m.muted=false;m.volume=1;m.onloadedmetadata=function(){storyDuration=Math.max(3000,Math.min(30000,(m.duration||15)*1000));try{m.play()}catch(e){}}}function tick(){if(storyPaused)return;var pct=Math.min(100,(Date.now()-storyStart)/storyDuration*100),bar=$('ith477Bar'+storyIndex);if(bar)bar.style.width=pct+'%';if(pct>=100)openStory(storyIndex+1)}storyTimer=setInterval(tick,70);['pointerdown','touchstart'].forEach(function(n){v.addEventListener(n,function(e){if(e.target.closest('.ith477StoryClose,.ith497StoryRecent,.ith497StoryMemberFeed'))return;storyPaused=true;if(isVideo)m.pause()},{passive:true})});['pointerup','touchend','pointercancel'].forEach(function(n){v.addEventListener(n,function(e){if(e.target&&e.target.closest&&e.target.closest('.ith497StoryRecent,.ith497StoryMemberFeed'))return;if(!storyPaused)return;storyPaused=false;storyStart=Date.now()-(parseFloat(($('ith477Bar'+storyIndex)||{}).style&&$('ith477Bar'+storyIndex).style.width)||0)/100*storyDuration;if(isVideo)m.play().catch(function(){})},{passive:true})})}


function native(){return window.OKITHAKI_ANDROID||window.AndroidBridge||null}
function nativeCall(k){var n=native(),args=[].slice.call(arguments,1);try{if(n&&typeof n[k]==='function')return n[k].apply(n,args)}catch(e){console.warn(k,e)}return null}
var externalFilter='all';
function privacyAccepted(){try{return localStorage.getItem('ith477_external_privacy_notice')==='1'}catch(e){return false}}
function openExternalCenter(fromPro,initial){externalFilter=initial||'all';if(!nativeCall('externalMessageCenterNativeV249477')&&!(window.__ITHAKI_EXTERNAL_SYNC_ITEMS_V249525__||[]).length){var b=tabBody(tr('Κέντρο Εξωτερικών Μηνυμάτων','External Message Center'));b.innerHTML='<section class="ith477Card ith477Notice"><b>'+esc(tr('Απαιτείται η εφαρμογή Android V249477.','The V249477 Android app is required.'))+'</b></section>';return false}if(!privacyAccepted())return renderExternalPrivacy();renderExternal();return false}
function renderExternalPrivacy(){var b=tabBody(tr('Τοπικό Κέντρο Εξωτερικών Μηνυμάτων','Local External Message Center'));b.innerHTML='<section class="ith477Card ith477Notice"><h3>'+esc(tr('Ρητή ενημέρωση τοπικής αποθήκευσης','Explicit local-storage notice'))+'</h3><p>'+esc(tr('Τα email, οι ειδοποιήσεις Viber, τα SMS/MMS, τα αρχεία, οι σημειώσεις και το ημερολόγιο που επιλέγετε αποθηκεύονται κρυπτογραφημένα μόνο σε αυτή τη συσκευή. Δεν αποστέλλονται και δεν δημιουργείται αντίγραφό τους στον server της OK ITHAKI. Η διαγραφή δεδομένων εφαρμογής ή η απεγκατάσταση μπορεί να τα αφαιρέσει οριστικά.','Email, Viber notifications, SMS/MMS, files, notes and calendar items you select are encrypted and stored only on this device. They are not sent to or backed up on the OK ITHAKI server. Clearing app data or uninstalling can remove them permanently.'))+'</p><div class="ith477LocalOnly">LOCAL ENCRYPTED · OPTIONAL CIPHERTEXT-ONLY SYNC</div><div class="ith477Row"><button id="ith477AcceptPrivacy" class="ith477Btn ith477Green">'+esc(tr('Κατάλαβα και ενεργοποιώ','I understand and enable'))+'</button><button id="ith477PrivacyNo" class="ith477Btn">'+esc(tr('Όχι τώρα','Not now'))+'</button></div></section>';$('ith477AcceptPrivacy').onclick=function(){localStorage.setItem('ith477_external_privacy_notice','1');renderExternal()};$('ith477PrivacyNo').onclick=renderProMenu}
function externalItems(){var a=[];try{a=JSON.parse(String(nativeCall('getExternalMessageCenterItemsV249477')||'[]'))||[]}catch(e){}var b=window.__ITHAKI_EXTERNAL_SYNC_ITEMS_V249525__||[],m={};a.concat(b.map(function(x){return Object.assign({synced_from_phone:true},x)})).forEach(function(x){if(x&&x.id)m[x.id]=x});return Object.keys(m).map(function(k){return m[k]})}
function saveExternal(x){return nativeCall('upsertExternalMessageCenterItemV249477',JSON.stringify(x))}
function renderExternal(){var b=tabBody(tr('Κέντρο Εξωτερικών Μηνυμάτων','External Message Center'));b.innerHTML='<section class="ith477Card ith477Notice"><div class="ith477LocalOnly">🔒 '+esc(tr('Κρυπτογραφημένα στη συσκευή — προαιρετικός συγχρονισμός μόνο ως ciphertext','Encrypted on device — optional ciphertext-only sync'))+'</div><p>'+esc(tr('Η ΙΘΑΚΗ εμφανίζει νέες ειδοποιήσεις. Με «Άνοιγμα» πηγαίνεις στην αρχική εφαρμογή. Με Κοινοποίηση προς OK ITHAKI εισάγεις μόνο όσα επιλέγεις.','ITHAKI mirrors new notifications. Open takes you to the original app. Share to OK ITHAKI imports only what you select.'))+'</p><button id="ith477NotificationAccess" class="ith477Btn">'+esc(tr('Άδεια πρόσβασης στις ειδοποιήσεις','Notification access permission'))+'</button></section><section class="ith477Card"><b>'+esc(tr('Πηγές','Sources'))+'</b><div class="ith477Grid" id="ith477Sources"></div></section><div class="ith477ExternalTabs" id="ith477ExtTabs"></div><div id="ith477ExtList"></div><section class="ith477Card"><div class="ith477Row"><button id="ith477Export" class="ith477Btn">'+esc(tr('Τοπικό κρυπτογραφημένο αντίγραφο','Local encrypted export'))+'</button><button id="ith477Wipe" class="ith477Btn ith477Danger">'+esc(tr('Διαγραφή όλων των τοπικών δεδομένων','Delete all local data'))+'</button></div></section>';
 $('ith477NotificationAccess').onclick=function(){nativeCall('openNotificationAccessSettingsV249477')};renderSources();renderExternalTabs();renderExternalList();$('ith477Export').onclick=function(){var p=nativeCall('exportExternalMessageCenterV249477');if(p){nativeCall('shareFilePath',p,'application/octet-stream');toast(tr('Δημιουργήθηκε τοπικό κρυπτογραφημένο αρχείο.','Local encrypted file created.'))}};$('ith477Wipe').onclick=function(){if(confirm(tr('Να διαγραφούν όλα τα τοπικά εξωτερικά μηνύματα και το ημερολόγιο;','Delete all local external messages and calendar data?'))){nativeCall('clearExternalMessageCenterV249477');renderExternalList()}}}
function renderSources(){var h=$('ith477Sources');if(!h)return;h.innerHTML=['email','viber','sms','other'].map(function(src){var on=!!nativeCall('getExternalSourceConsentV249477',src),title=src==='email'?'Email':src==='viber'?'Viber':src==='sms'?'SMS/MMS':tr('Άλλες εφαρμογές','Other apps');return'<button class="ith477Tile" data-source="'+src+'"><b>'+(on?'✅ ':'○ ')+title+'</b><small>'+esc(on?tr('Νέες ειδοποιήσεις ενεργές','New notification mirror enabled'):tr('Πατήστε για ρητή ενεργοποίηση','Tap for explicit consent'))+'</small></button>'}).join('');h.onclick=function(e){var q=e.target.closest('[data-source]');if(!q)return;var src=q.dataset.source,on=!!nativeCall('getExternalSourceConsentV249477',src);if(!on&&!confirm(tr('Ενεργοποίηση μόνο για νέες ειδοποιήσεις '+src+'. Τα δεδομένα μένουν κρυπτογραφημένα στο κινητό. Προαιρετικός συγχρονισμός αποθηκεύει στον server μόνο κρυπτογραφημένο snapshot.','Enable only new '+src+' notifications. Data stays encrypted on this phone. Optional sync stores only an encrypted snapshot on the server.')))return;nativeCall('setExternalSourceConsentV249477',src,!on);renderSources()}}
function renderExternalTabs(){var h=$('ith477ExtTabs');if(!h)return;var tabs=[['all',tr('Όλα','All')],['email','Email'],['viber','Viber'],['sms','SMS/MMS'],['other',tr('Άλλες εφαρμογές','Other apps')],['unread',tr('Αδιάβαστα','Unread')],['important',tr('Σημαντικά','Important')],['archived',tr('Αρχειοθετημένα','Archived')],['calendar',tr('Ημερολόγιο','Calendar')],['notes',tr('Σημειώσεις','Notes')]];h.innerHTML=tabs.map(function(x){return'<button class="ith477Btn '+(externalFilter===x[0]?'active':'')+'" data-exttab="'+x[0]+'">'+esc(x[1])+'</button>'}).join('');h.onclick=function(e){var q=e.target.closest('[data-exttab]');if(q){externalFilter=q.dataset.exttab;renderExternalTabs();renderExternalList()}}}
function filteredExternal(){var a=externalItems().slice().sort(function(a,b){return Number(b.created_at||b.updated_at||0)-Number(a.created_at||a.updated_at||0)});return a.filter(function(x){if(externalFilter==='all')return x.item_type!=='calendar';if(['email','viber','sms','other'].includes(externalFilter))return x.source===externalFilter;if(externalFilter==='unread')return!!x.unread;if(externalFilter==='important')return!!x.important;if(externalFilter==='archived')return!!x.archived;if(externalFilter==='calendar')return x.item_type==='calendar'||!!x.due_at;if(externalFilter==='notes')return!!String(x.note||'').trim();return true})}
function renderExternalList(){var h=$('ith477ExtList');if(!h)return;var a=filteredExternal();h.innerHTML=a.map(function(x){return'<section class="ith477Card ith477Msg" data-mid="'+esc(x.id)+'"><div class="ith477MsgMeta"><span class="ith477Badge">'+esc(String(x.source||'shared').toUpperCase())+'</span>'+(x.unread?'<span class="ith477Badge">'+esc(tr('Αδιάβαστο','Unread'))+'</span>':'')+(x.important?'<span class="ith477Badge">⭐ '+esc(tr('Σημαντικό','Important'))+'</span>':'')+(x.archived?'<span class="ith477Badge">📦 '+esc(tr('Αρχειοθετημένο','Archived'))+'</span>':'')+'<small>'+esc(new Date(Number(x.created_at||Date.now())).toLocaleString())+'</small></div><b>'+esc(x.title||tr('Μήνυμα','Message'))+'</b><div>'+esc(x.body||'')+'</div>'+(x.local_path?'<button class="ith477Btn" data-act="file">📎 '+esc(x.title||tr('Αρχείο','File'))+'</button>':'')+(x.note?'<div class="ith477Card">📝 '+esc(x.note)+'</div>':'')+(x.due_at?'<div class="ith477Status">📅 '+esc(new Date(Number(x.due_at)).toLocaleString())+'</div>':'')+'<div class="ith477Row"><button class="ith477Btn" data-act="open">'+esc(tr('Άνοιγμα αρχικής εφαρμογής','Open original app'))+'</button><button class="ith477Btn" data-act="read">'+esc(x.unread?tr('Διαβάστηκε','Mark read'):tr('Αδιάβαστο','Mark unread'))+'</button><button class="ith477Btn" data-act="important">⭐</button><button class="ith477Btn" data-act="archive">📦</button><button class="ith477Btn" data-act="note">📝</button><button class="ith477Btn" data-act="calendar">📅</button><button class="ith477Btn ith477Danger" data-act="delete">🗑️</button></div></section>'}).join('')||'<section class="ith477Card">'+esc(tr('Δεν υπάρχουν τοπικά στοιχεία σε αυτή την καρτέλα.','No local items in this tab.'))+'</section>';h.onclick=function(e){var card=e.target.closest('[data-mid]'),q=e.target.closest('[data-act]');if(!card||!q)return;var x=externalItems().find(function(z){return z.id===card.dataset.mid});if(!x)return;var a=q.dataset.act;if(a==='open'){if(!nativeCall('openExternalNotificationV249477',x.id)&&!nativeCall('openExternalSourceAppV249477',x.source))toast(x.synced_from_phone?tr('Άνοιγμα εφαρμογής γίνεται από το κινητό που συνέλεξε την ειδοποίηση.','Open the source app on the phone that collected the notification.'):tr('Δεν άνοιξε η αρχική εφαρμογή.','The original app did not open.'));return}if(a==='file'){nativeCall('openFilePath',x.local_path,x.mime_type||'application/octet-stream');return}if(a==='delete'){nativeCall('deleteExternalMessageCenterItemV249477',x.id);return renderExternalList()}if(a==='read')x.unread=!x.unread;if(a==='important')x.important=!x.important;if(a==='archive')x.archived=!x.archived;if(a==='note'){var n=prompt(tr('Ιδιωτική σημείωση','Private note'),x.note||'');if(n===null)return;x.note=n}if(a==='calendar'){var when=prompt(tr('Ημερομηνία/ώρα υπενθύμισης (π.χ. 2026-08-01 10:30)','Reminder date/time (e.g. 2026-08-01 10:30)'),'');if(when===null)return;var t=Date.parse(when.replace(' ','T'));if(!isFinite(t))return toast(tr('Μη έγκυρη ημερομηνία.','Invalid date.'));x.due_at=t}saveExternal(x);renderExternalList()}}

function renderCalendarOnly(){openExternalCenter(true,'calendar')}
function returnFromWallToProV249496(){var f=I().closeWallSilentV249496||window.closeWallSilentV249496;if(typeof f==='function')f();else{var wall=$('ithV411Wall');if(wall)wall.remove()}if(!$('ithProCenterV249477'))renderProMenu();return false}
function addWallArrow(){var wall=$('ithV411Wall')||document.querySelector('[id*="wall" i][class*="modal" i],[id*="wall" i][class*="screen" i]');if(!wall)return;var original=$('v411Close');if(original){original.onclick=returnFromWallToProV249496;original.title=tr('Επιστροφή στις επιλογές','Back to choices')}if(wall.querySelector('.ith477EscapeArrow'))return;var b=document.createElement('button');b.className='ith477EscapeArrow';b.textContent='‹';b.title=tr('Επιστροφή στις επιλογές','Back to choices');b.onclick=returnFromWallToProV249496;wall.style.position=wall.style.position||'relative';wall.appendChild(b)}
function openAnonymousWall(){var f=I().openCurrentWallV249440||I().openWallV411||window.openWallV411;if(typeof f==='function')f();setTimeout(addWallArrow,30);setTimeout(addWallArrow,250);return false}
function wrapComments(){var ith=I(),fn=ith.openPostCommentsPanel||window.openPostCommentsPanel;if(typeof fn!=='function'||fn.__v249477)return;var w=async function(id){var r=await fn.apply(this,arguments);setTimeout(function(){injectCommentTools(id)},20);return r};w.__v249477=true;ith.openPostCommentsPanel=w;window.openPostCommentsPanel=w}
function injectCommentTools(id){var c=document.querySelector('.commentComposer');if(!c||c.querySelector('.ith477CommentTools'))return;var t=document.createElement('div');t.className='ith477CommentTools';t.innerHTML='<button data-kind="photo" title="'+esc(tr('Φωτογραφία','Photo'))+'">📷</button><button data-kind="video" title="'+esc(tr('Βίντεο','Video'))+'">🎥</button><button data-kind="file" title="'+esc(tr('Αρχείο','File'))+'">📎</button>';t.onclick=function(e){var q=e.target.closest('[data-kind]');if(q){var f=I().chooseFile||window.chooseFile;if(typeof f==='function')f('comment',q.dataset.kind,String(id||S().commentPostId||''))}};c.insertBefore(t,c.firstChild);document.querySelectorAll('.commentBubble video,.commentBubble audio').forEach(function(m){m.autoplay=false;m.muted=true;try{m.pause()}catch(e){}})}
var maintainQueued=false;function scheduleMaintain(){if(maintainQueued)return;maintainQueued=true;setTimeout(function(){maintainQueued=false;maintain()},60)}
function keepStoryBarOnFeedV249494(){try{if(document.body.getAttribute('data-page')!=='feed'||window.__ITHAKI_MEMBER_FEED_MODE_V249483__===true||window.__ITHAKI_MEMBER_FEED_MODE_V249481__===true)return;var now=Date.now();if($('ith477StoryBarWrap'))return;if(now-lastStoryBarAttemptV249494<2500)return;lastStoryBarAttemptV249494=now;loadStoryBar(true)}catch(e){}}
function maintain(){addCss();removeBilOutsideNotifications();forceDirectProfessionalEntry();wrapNotifications();renderBilNotification();wrapComments();addWallArrow();keepStoryBarOnFeedV249494()}
function install(){addCss();removeBilOutsideNotifications();document.addEventListener('click',captureProfessionalEntry,true);['openProfessionalCenterV249383','openProfessionalCenterV249384','openProfessionalCenterV249386','openProfessionalCenterFastV249392'].forEach(function(k){var f=I()[k];if(typeof f==='function'&&!oldProOpen[k])oldProOpen[k]=f;I()[k]=openProCenter});I().openProfessionalCenterV249477=openProCenter;I().openProfessionalCenterV249499=openProCenter;I().openDirectAdminContactV249499=renderAdminTab;I().renderProfessionalMenuV249499=renderProMenu;I().openExternalMessageCenterV249477=openExternalCenter;I().openProfessionalStoriesV249477=renderStoriesTab;I().openStoryStudioPreviewV249482=openStoryStudioPreviewV249482;I().publishStoryFromPreviewV249482=publishStoryFromPreviewV249482;I().renderStorySelectionV249494=renderStorySelectionV249494;I().routeStoryToFeedV249494=routeStoryToFeedV249494;I().setBilNotificationOnlyV249477=setBil;I().loadProfessionalStoryBarV249477=loadStoryBar;I().renderLocalProfessionalCalendarV249477=renderCalendarOnly;I().openProfessionalCreatorToolsV249496=renderCreatorTools;I().returnFromProfessionalWallV249496=returnFromWallToProV249496;I().openStoryMemberFeedV249497=openStoryMemberFeedV249497;wrapNotifications();wrapComments();maintain();setInterval(scheduleMaintain,1500);if(document.body){new MutationObserver(scheduleMaintain).observe(document.body,{subtree:true,childList:true})}window.addEventListener('ithaki:page-changed',function(e){var p=String(e&&e.detail&&e.detail.page||'');if(p==='feed')setTimeout(function(){loadStoryBar(false)},100);else stopStory()});setInterval(function(){if(nativeCall('consumeExternalCenterLaunchV249477')){var f=I().openExternalMessageCenterV249477;if(typeof f==='function')f(false,'inbox')}},1000);document.documentElement.setAttribute('data-ithaki-v249477','pro-center-stories-local-external-messages');document.documentElement.setAttribute('data-ithaki-v249495','story-studio-clean-close-normal-view');document.documentElement.setAttribute('data-ithaki-v249496','professional-tabs-creator-names');document.documentElement.setAttribute('data-ithaki-v249499','runtime-own-feed-admin-inbox-real-story-avatars')}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',function(){setTimeout(install,0)},{once:true});else setTimeout(install,0);
})();
