/* OK ITHAKI V249500 - SINGLE HOME OWNER / TWO-COLUMN FULL HOME / HOME AVATAR TRUTH */
(function(){'use strict';if(window.__ITHAKI_V249500_RUNTIME_OWNER__)return;window.__ITHAKI_V249500_RUNTIME_OWNER__={singleHomeOwner:true,twoColumns:true,homeAvatarTruth:true,transparentRaisedNav:true};window.__ITHAKI_V249500_HOME_OWNER__=true;
const $=id=>document.getElementById(id),I=()=>window.ITH||{},S=()=>window.state||I().state||{};
function css(){if($('ithV249500Css'))return;const s=document.createElement('style');s.id='ithV249500Css';s.textContent=`
.ithActionsV249461{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:minmax(118px,1fr)!important;width:100%!important;max-width:980px!important;min-height:clamp(390px,54dvh,650px)!important;gap:12px!important;padding:2px 2px calc(94px + env(safe-area-inset-bottom))!important;margin:0 auto!important}.ithActionsV249461>.ithActionV249461{grid-column:auto!important;width:100%!important;min-width:0!important;min-height:118px!important;margin:0!important}.ithHomeV249461{padding-bottom:calc(96px + env(safe-area-inset-bottom))!important}
#feedPage .feedAvatarOverlay .avatar,#feedPage .postHead .avatar,#feedPage .postAvatar,#ith477StoryBarWrap .ith500StoryAvatar>.avatar{background:transparent!important;filter:none!important;opacity:1!important;visibility:visible!important;mix-blend-mode:normal!important;overflow:hidden!important}#feedPage .feedAvatarOverlay .avatar img,#feedPage .postHead .avatar img,#feedPage .postAvatar img,#ith477StoryBarWrap .ith500StoryAvatar>.avatar img{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;border-radius:50%!important;background:transparent!important;filter:none!important;opacity:1!important;visibility:visible!important;mix-blend-mode:normal!important}
body .nav{bottom:max(17px,calc(env(safe-area-inset-bottom) + 10px))!important;background:transparent!important;background-image:none!important;border:1px solid rgba(255,255,255,.18)!important;box-shadow:0 8px 24px rgba(0,0,0,.16)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;overflow:visible!important}body .nav button{background:transparent!important;background-image:none!important}
@media(max-width:760px){.ithActionsV249461{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:minmax(112px,1fr)!important;min-height:clamp(350px,51dvh,520px)!important;gap:9px!important;padding-bottom:calc(88px + env(safe-area-inset-bottom))!important}.ithActionsV249461>.ithActionV249461{min-height:112px!important}.ithActionV249461 small{font-size:10px!important;max-width:145px!important}body .nav{bottom:max(15px,calc(env(safe-area-inset-bottom) + 9px))!important}}
`;document.head.appendChild(s)}
function person(id){id=String(id||'');const s=S();let p={};try{if(s.people&&typeof s.people.get==='function')p=s.people.get(id)||{};else if(Array.isArray(s.people))p=s.people.find(q=>String(q&&q.device_id||q&&q.id||'')===id)||{}}catch(e){}const me=String(s.device||s.device_id||'');if(id&&id===me)p=Object.assign({},p,{avatar:s.avatar||p.avatar||'',nickname:s.name||s.nickname||p.nickname||'Μέλος'});return Object.assign({id,device_id:id,nickname:'Μέλος',avatar:''},p)}
function homeAvatarNode(p){try{const f=window.avatarHtml||I().avatarHtml;if(typeof f==='function'){const h=document.createElement('div');h.innerHTML=f(p);return h.firstElementChild}}catch(e){}const a=document.createElement('span');a.className='avatar';a.textContent=String((p.nickname||'Μ').slice(0,1));return a}
function repairFeedAvatars(){document.querySelectorAll('#feedPage [data-sender]').forEach(post=>{const id=String(post.getAttribute('data-sender')||post.dataset.sender||'');if(!id)return;const p=person(id);post.querySelectorAll('.feedAvatarOverlay .avatar,.postHead .avatar,.postAvatar').forEach(old=>{const sig=id+'|'+String(p.avatar||p.photo||'');if(old.dataset&&old.dataset.v249500AvatarSig===sig)return;const fresh=homeAvatarNode(p);if(!fresh)return;fresh.dataset.v249500AvatarSig=sig;old.replaceWith(fresh)})})}
function repairStoryAvatars(){document.querySelectorAll('#ith477StoryBarWrap [data-story]').forEach(btn=>{const i=Number(btn.getAttribute('data-story')||0),arr=(window.ITH&&window.ITH.__storyListV249500)||null;const ring=btn.querySelector('.ith500StoryAvatar');if(ring)ring.style.background='transparent'})}
function canonical(){return true}
function run(){css();document.documentElement.setAttribute('data-ithaki-v249500-home-avatar','single-home-avatar-truth')}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',run,{once:true});else run();new MutationObserver(()=>{clearTimeout(window.__ith500mo);window.__ith500mo=setTimeout(run,70)}).observe(document.documentElement,{subtree:true,childList:true});setInterval(run,1600);
})();
