/* OK ITHAKI V249526R6 — ONE COMMUNITY SHARE / STABLE PANELS / CANONICAL COMMUNITY DEDUP */
(function(){
'use strict';
if(window.__ITHAKI_V249526R6_OWNER__)return;
window.__ITHAKI_V249526R6_OWNER__={version:'V249526R6',oneCommunityShare:true,communityPanelsStable:true,canonicalCommunityDedup:true,legacyShareOwnersStopped:true,at:Date.now()};
const ONE_COMMUNITY_SHARE_OWNER_R6=true,COMMUNITY_PANEL_NO_AUTO_CLOSE_R6=true,COMMUNITY_CANONICAL_TITLE_DEDUP_R6=true,LEGACY_SHARE_REINSTALL_DISABLED_R6=true;
const $=id=>document.getElementById(id);
function norm(v){return String(v||'').normalize('NFD').replace(/[̀-ͯ]/g,'').replace(/[^a-zA-Z0-9Ͱ-Ͽ]+/g,' ').replace(/\s+/g,' ').trim().toLocaleLowerCase('el')}
function cleanupShareLayers(){const active=$('ith526R3ShareChoice');if(active)document.querySelectorAll('#ith524ShareChoice,#ith526R2ShareChoice,#ithShareOverlayV249433,#ithFriendPickerV249433').forEach(x=>x.remove());const current=[...document.querySelectorAll('#ith526R3ShareChoice')];current.slice(1).forEach(x=>x.remove())}
function dedupeCommunityRows(){if(window.__ITHAKI_R10F13_SINGLE_COMMUNITY_RUNTIME__)return 0;const list=$('ith516List');if(!list)return;const ids=new Set(),titles=new Set();list.querySelectorAll(':scope > .ith516Row,:scope > [data-space-id]').forEach(row=>{const id=String(row.dataset.spaceId||row.getAttribute('data-subroom-id')||'').trim();const title=norm(row.querySelector('.who b,b')?.textContent||'');if((id&&ids.has(id))||(title&&titles.has(title))){row.remove();return}if(id)ids.add(id);if(title)titles.add(title)})}
function preserveCommunityPanel(){if(document.body?.dataset.page!=='spaces')return;const m=$('memberMenu');if(m&&m.children.length&&m.dataset.ith526Owner!=='notifications'){m.setAttribute('aria-hidden','false')}}
function audit(){cleanupShareLayers();dedupeCommunityRows();preserveCommunityPanel();try{localStorage.setItem('ith_frontend_build','V249526R6-single-community-share-owner');document.documentElement.setAttribute('data-ithaki-v249526r6','single-community-share-owner')}catch(e){}}
function install(){audit();new MutationObserver(()=>{clearTimeout(install._m);install._m=setTimeout(audit,60)}).observe(document.body,{subtree:true,childList:true});window.addEventListener('ithaki:page-changed',()=>setTimeout(audit,30));window.addEventListener('pageshow',audit)}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',install,{once:true});else install();
})();
