/* OK ITHAKI V249526R10F5 — FOCUSED DISCUSSIONS / BILINGUAL / THEME COLORS */
(function(){
'use strict';
if(window.__ITHAKI_V249526R10F5_WALL_FOCUS__)return;
window.__ITHAKI_V249526R10F5_WALL_FOCUS__={version:'V249526R10F5',focusedSingleDiscussion:true,smallInlineDiscussionButton:true,bilingualGreekEnglish:true,themeColorAligned:true,at:Date.now()};
window.WALL_FOCUSED_SINGLE_DISCUSSION_R10F5=true;
window.WALL_SMALL_INLINE_REPLY_R10F5=true;
window.WALL_BILINGUAL_THEME_R10F5=true;
const $=id=>document.getElementById(id);
const esc=s=>String(s==null?'':s).replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
const I=()=>window.ITH=window.ITH||{},S=()=>window.state||I().state||{};
const state={root:null,lang:'el',mode:'listen',filter:'all',posts:[],selectedId:'',socket:null,seq:0,loading:false};
const TEXT={
 el:{safe:'OK ITHAKI · ΑΝΩΝΥΜΟΣ ΤΟΙΧΟΣ',title:'Σε ακούν ή συζητούν μαζί σου',subtitle:'Επίλεξε μία συζήτηση για να εμφανιστεί μόνη της.',live:'τώρα',all:'Όλα',listenFilter:'👂 Μόνο ακούν',discussionFilter:'💬 Συζητήσεις',loading:'Φόρτωση…',emptyTitle:'Δεν υπάρχουν ακόμη μηνύματα σε αυτή την επιλογή.',emptyText:'Κάθε μήνυμα εμφανίζεται ξεχωριστά, ένα κάτω από το άλλο.',anonymousVoice:'Ανώνυμη φωνή',listenMode:'👂 Μόνο να με ακούσουν',discussionMode:'💬 Συζήτηση',listenInfo:'Αυτό το μήνυμα δεν δέχεται απαντήσεις. Οι άλλοι το διαβάζουν και σε ακούν.',openDiscussion:'Άνοιγμα συζήτησης',replies:'απαντήσεις',oneReply:'απάντηση',backAll:'Όλα τα μηνύματα',threadTitle:'Συζήτηση για αυτό το μήνυμα',threadInfo:'Εδώ εμφανίζονται μόνο οι απαντήσεις αυτής της ανάρτησης.',anonymousReply:'Ανώνυμη απάντηση',noReplies:'Δεν υπάρχει ακόμη απάντηση. Γράψε την πρώτη μόνο για αυτή τη συζήτηση.',replyPlaceholder:'Γράψε απάντηση μόνο σε αυτή τη συζήτηση…',sendReply:'Αποστολή απάντησης',showAll:'Προβολή όλων',composeListen:'👂 Μόνο να με ακούσουν',composeListenSub:'Χωρίς απαντήσεις',composeDiscussion:'💬 Συζήτηση',composeDiscussionSub:'Ξεχωριστό νήμα απαντήσεων',listenHint:'Οι άλλοι θα το διαβάσουν χωρίς δυνατότητα απάντησης.',discussionHint:'Κάθε απάντηση θα συνδέεται μόνο με αυτό το μήνυμα.',postPlaceholder:'Γράψε ανώνυμα το μήνυμά σου…',anonymousSeparate:'Ανώνυμα · κάθε μήνυμα χωριστά',writeMessage:'Γράψε πρώτα το μήνυμά σου.',postedDiscussion:'Δημοσιεύτηκε ως συζήτηση.',postedListen:'Δημοσιεύτηκε για να σε ακούσουν.',sendFailed:'Δεν στάλθηκε',threadLoadFailed:'Δεν φορτώθηκαν οι απαντήσεις.',writeReply:'Γράψε πρώτα την απάντηση.',listenDisabled:'Αυτό το μήνυμα είναι «Μόνο να με ακούσουν».',replyFailed:'Η απάντηση δεν στάλθηκε',reactionFailed:'Η αντίδραση δεν καταχωρήθηκε.',reportOk:'Η αναφορά καταχωρήθηκε.',reportFailed:'Η αναφορά δεν καταχωρήθηκε.',wallFailed:'Ο Τοίχος δεν φορτώθηκε.',report:'Αναφορά',back:'Επιστροφή',close:'Κλείσιμο',support:'στήριξη',hope:'ελπίδα',together:'μαζί',calm:'ηρεμία'},
 en:{safe:'OK ITHAKI · ANONYMOUS WALL',title:'Be heard or start a discussion',subtitle:'Select one discussion to view it on its own.',live:'now',all:'All',listenFilter:'👂 Listen only',discussionFilter:'💬 Discussions',loading:'Loading…',emptyTitle:'There are no messages in this view yet.',emptyText:'Each message appears separately, one below the other.',anonymousVoice:'Anonymous voice',listenMode:'👂 Listen only',discussionMode:'💬 Discussion',listenInfo:'This message does not accept replies. Others can read it and listen.',openDiscussion:'Open discussion',replies:'replies',oneReply:'reply',backAll:'All messages',threadTitle:'Discussion for this message',threadInfo:'Only replies to this post appear here.',anonymousReply:'Anonymous reply',noReplies:'There is no reply yet. Write the first one only for this discussion.',replyPlaceholder:'Write a reply only in this discussion…',sendReply:'Send reply',showAll:'Show all',composeListen:'👂 Listen only',composeListenSub:'No replies',composeDiscussion:'💬 Discussion',composeDiscussionSub:'Separate reply thread',listenHint:'Others can read it without replying.',discussionHint:'Every reply will stay attached only to this message.',postPlaceholder:'Write your anonymous message…',anonymousSeparate:'Anonymous · each message separate',writeMessage:'Write your message first.',postedDiscussion:'Published as a discussion.',postedListen:'Published for others to listen.',sendFailed:'Not sent',threadLoadFailed:'Replies could not be loaded.',writeReply:'Write your reply first.',listenDisabled:'This message is set to “Listen only”.',replyFailed:'The reply was not sent',reactionFailed:'The reaction was not saved.',reportOk:'The report was submitted.',reportFailed:'The report was not submitted.',wallFailed:'The Wall could not be loaded.',report:'Report',back:'Back',close:'Close',support:'support',hope:'hope',together:'together',calm:'calm'}
};
function lang(){try{const q=new URLSearchParams(location.search).get('lang');const x=String(localStorage.getItem('ith_ui_lang_v249141')||localStorage.getItem('ith_ui_lang')||q||document.documentElement.lang||'el').toLowerCase();return x.startsWith('en')?'en':'el'}catch(e){return'el'}}
function t(k){return(TEXT[state.lang]||TEXT.el)[k]||TEXT.el[k]||k}
function room(){return String(S().room||localStorage.getItem('ith_room')||'ithaki-phone-test')}
function device(){return String(S().device||localStorage.getItem('ith_device')||'')}
function api(path){let b=String(S().api||'').replace(/\/+$/,'');if(!b||/appassets\.androidplatform\.net/i.test(b))b='https://ok-ithaki.gr';return /^https?:/i.test(path)?path:b+path}
function toast(msg,ms=4300){try{if(typeof I().toast==='function')return I().toast(String(msg),ms)}catch(e){}const x=$('toast');if(x){x.textContent=String(msg);x.classList.add('show');clearTimeout(toast._t);toast._t=setTimeout(()=>x.classList.remove('show'),ms)}}
async function getJson(path){const r=await fetch(api(path),{cache:'no-store',credentials:'include'});if(!r.ok)throw new Error('HTTP '+r.status);return r.json()}
async function postJson(path,data){const r=await fetch(api(path),{method:'POST',headers:{'Content-Type':'application/json'},credentials:'include',body:JSON.stringify(data)});if(!r.ok){let d={};try{d=await r.json()}catch(e){}throw new Error(d.detail||d.message||('HTTP '+r.status))}return r.json()}
function uid(prefix){try{return prefix+crypto.randomUUID()}catch(e){return prefix+Date.now().toString(36)+'_'+Math.random().toString(36).slice(2)}}
function when(ts){try{return new Date((Number(ts)||Date.now()/1000)*1000).toLocaleString(state.lang==='en'?'en-GB':'el-GR',{day:'2-digit',month:'short',hour:'2-digit',minute:'2-digit'})}catch(e){return state.lang==='en'?'now':'τώρα'}}
function normReply(r){return{id:String(r.reply_id||r.id||''),postId:String(r.post_id||''),text:String(r.text||r.body||''),created:Number(r.created_at||0)}}
function dedupeReplies(a){const m=new Map();(a||[]).forEach(raw=>{const r=normReply(raw);if(r.id&&r.text)m.set(r.id,r)});return[...m.values()].sort((a,b)=>a.created-b.created)}
function normalize(data){const m=new Map();for(const raw of(data&&data.posts||[])){const id=String(raw.post_id||raw.id||'');if(!id)continue;const mode=String(raw.mode||'listen')==='discussion'?'discussion':'listen';const p={id,text:String(raw.text||''),created:Number(raw.created_at||0),mode,replyCount:mode==='discussion'?Number(raw.reply_count||0):0,replies:mode==='discussion'?dedupeReplies(raw.recent_replies||[]):[]};const old=m.get(id);if(!old||p.created>=old.created)m.set(id,p)}return[...m.values()].sort((a,b)=>b.created-a.created)}
function modeLabel(mode){return mode==='discussion'?t('discussionMode'):t('listenMode')}
const REACTIONS=()=>[['❤️',t('support')],['🤝',t('together')],['🌟',t('hope')],['🫶',t('together')],['🙏',t('hope')]];
function reactionHtml(p){return '<footer class="ith534Reactions">'+REACTIONS().map(r=>'<button type="button" data-r10f5-react="'+esc(r[0])+'" data-r10f5-post="'+esc(p.id)+'" title="'+esc(r[1])+'"><span>'+r[0]+'</span><i>0</i></button>').join('')+'</footer>'}
function replyHtml(r){return '<article class="ith534Reply" data-reply-id="'+esc(r.id)+'"><header><b>'+esc(t('anonymousReply'))+'</b><small>'+esc(when(r.created))+'</small></header><p>'+esc(r.text)+'</p></article>'}
function smallDiscussionButton(p){const count=Number(p.replyCount||0),label=count===1?t('oneReply'):t('replies');return '<button type="button" class="ith534OpenDiscussion" data-open-discussion="'+esc(p.id)+'"><span>💬</span><b>'+esc(t('openDiscussion'))+'</b><small>'+count+' '+esc(label)+'</small></button>'}
function listCardHtml(p){const selectable=p.mode==='discussion';return '<article class="ith534WallCard '+p.mode+(selectable?' selectable':'')+'" data-wall="'+esc(p.id)+'" data-mode="'+p.mode+'" '+(selectable?'data-open-card="'+esc(p.id)+'" tabindex="0" role="button"':'')+'><header><span class="ith534Avatar">◌</span><div><b>'+esc(t('anonymousVoice'))+'</b><small>'+esc(when(p.created))+'</small></div><span class="ith534Mode '+p.mode+'">'+esc(modeLabel(p.mode))+'</span><button type="button" data-r10f5-report="'+esc(p.id)+'" aria-label="'+esc(t('report'))+'">⚑</button></header><p class="ith534PostText">'+esc(p.text)+'</p>'+reactionHtml(p)+(p.mode==='discussion'?smallDiscussionButton(p):'<div class="ith534ListenOnly"><b>'+esc(t('listenMode'))+'</b><span>'+esc(t('listenInfo'))+'</span></div>')+'</article>'}
function focusedThreadHtml(p){const hidden=Math.max(0,Number(p.replyCount||0)-p.replies.length);return '<section class="ith534Thread" data-thread-post="'+esc(p.id)+'"><header><div><b>'+esc(t('threadTitle'))+'</b><small>'+esc(t('threadInfo'))+'</small></div>'+(hidden?'<button type="button" data-load-thread="'+esc(p.id)+'">'+esc(t('showAll'))+' ('+p.replyCount+')</button>':'')+'</header><div class="ith534ReplyList">'+(p.replies.length?p.replies.map(replyHtml).join(''):'<div class="ith534NoReplies">'+esc(t('noReplies'))+'</div>')+'</div><div class="ith534ReplyComposer"><textarea maxlength="500" data-reply-text="'+esc(p.id)+'" placeholder="'+esc(t('replyPlaceholder'))+'"></textarea><button type="button" data-send-reply="'+esc(p.id)+'" aria-label="'+esc(t('sendReply'))+'" title="'+esc(t('sendReply'))+'">➤</button></div></section>'}
function focusedCardHtml(p){return '<section class="ith534Focus"><button type="button" class="ith534BackAll" data-back-all>‹ <span>'+esc(t('backAll'))+'</span></button><article class="ith534WallCard discussion focused" data-wall="'+esc(p.id)+'"><header><span class="ith534Avatar">◌</span><div><b>'+esc(t('anonymousVoice'))+'</b><small>'+esc(when(p.created))+'</small></div><span class="ith534Mode discussion">'+esc(t('discussionMode'))+'</span><button type="button" data-r10f5-report="'+esc(p.id)+'" aria-label="'+esc(t('report'))+'">⚑</button></header><p class="ith534PostText">'+esc(p.text)+'</p>'+reactionHtml(p)+focusedThreadHtml(p)+'</article></section>'}
function filtered(){return state.posts.filter(p=>state.filter==='all'||p.mode===state.filter)}
function render(){const list=$('ith534WallList');if(!list)return;if(state.selectedId){const p=state.posts.find(x=>x.id===state.selectedId);if(p&&p.mode==='discussion'){list.innerHTML=focusedCardHtml(p);state.root&&state.root.classList.add('ith534ThreadOpen');hydrateReactions();setTimeout(()=>document.querySelector('[data-reply-text="'+CSS.escape(p.id)+'"]')?.focus(),50);return}state.selectedId=''}state.root&&state.root.classList.remove('ith534ThreadOpen');const posts=filtered();list.innerHTML=posts.length?posts.map(listCardHtml).join(''):'<section class="ith534Empty"><span>◌</span><b>'+esc(t('emptyTitle'))+'</b><small>'+esc(t('emptyText'))+'</small></section>';hydrateReactions()}
async function hydrateReactions(){const ids=state.posts.map(x=>x.id).slice(0,120);if(!ids.length)return;try{const d=await getJson('/api/v411/wall/reactions?room_id='+encodeURIComponent(room())+'&post_ids='+encodeURIComponent(ids.join(','))+'&device_id='+encodeURIComponent(device()));const live=$('ith534WallLive');if(live)live.textContent=String(d.live_now||0);for(const it of(d.items||[])){const c=document.querySelector('.ith534WallCard[data-wall="'+CSS.escape(String(it.post_id))+'"]');if(!c)continue;c.querySelectorAll('[data-r10f5-react]').forEach(b=>{const e=b.dataset.r10f5React;b.querySelector('i').textContent=String((it.counts||{})[e]||0);b.classList.toggle('active',Array.isArray(it.mine)&&it.mine.includes(e))})}}catch(e){}}
async function react(btn){if(btn.disabled)return;btn.disabled=true;try{const d=await postJson('/api/v411/wall/reaction',{room_id:room(),post_id:btn.dataset.r10f5Post,device_id:device(),emoji:btn.dataset.r10f5React});const c=btn.closest('.ith534WallCard');c&&c.querySelectorAll('[data-r10f5-react]').forEach(x=>{const e=x.dataset.r10f5React;x.querySelector('i').textContent=String((d.counts||{})[e]||0);x.classList.toggle('active',Array.isArray(d.mine)&&d.mine.includes(e))})}catch(e){toast(t('reactionFailed'))}finally{setTimeout(()=>btn.disabled=false,250)}}
async function load(){const seq=++state.seq;state.loading=true;try{const d=await getJson('/api/wall/list_v249533?room_id='+encodeURIComponent(room())+'&limit=100');if(seq!==state.seq)return;state.posts=normalize(d);const live=$('ith534WallLive');if(live)live.textContent=String(d.live_now||0);render()}finally{if(seq===state.seq)state.loading=false}}
function setMode(mode){state.mode=mode==='discussion'?'discussion':'listen';try{localStorage.setItem('ith533_wall_mode',state.mode)}catch(e){}document.querySelectorAll('[data-compose-mode]').forEach(b=>{const on=b.dataset.composeMode===state.mode;b.classList.toggle('active',on);b.setAttribute('aria-pressed',on?'true':'false')});const hint=$('ith534ModeHint');if(hint)hint.textContent=state.mode==='discussion'?t('discussionHint'):t('listenHint')}
async function sendPost(){const ta=$('ith534WallText'),btn=$('ith534WallSend');if(!ta||!btn)return;const text=ta.value.trim();if(!text)return toast(t('writeMessage'));btn.disabled=true;try{await postJson('/api/wall/post_v249533',{room_id:room(),owner_token:device(),text,mode:state.mode,client_key:uid('wallpost_')});ta.value='';const count=$('ith534WallCount');if(count)count.textContent='0/500';await load();toast(state.mode==='discussion'?t('postedDiscussion'):t('postedListen'))}catch(e){toast(t('sendFailed')+': '+String(e.message||e))}finally{btn.disabled=false}}
async function loadThread(postId,openAfter){const p=state.posts.find(x=>x.id===postId);if(!p||p.mode!=='discussion')return;try{const d=await getJson('/api/wall/replies_v249533?room_id='+encodeURIComponent(room())+'&post_id='+encodeURIComponent(postId)+'&limit=240');p.replies=dedupeReplies(d.replies||[]);p.replyCount=Number(d.reply_count||p.replies.length);if(openAfter)state.selectedId=postId;render()}catch(e){toast(t('threadLoadFailed'))}}
async function openDiscussion(postId){const p=state.posts.find(x=>x.id===postId);if(!p||p.mode!=='discussion')return;state.selectedId=postId;render();await loadThread(postId,true)}
async function sendReply(postId){const ta=document.querySelector('[data-reply-text="'+CSS.escape(postId)+'"]'),btn=document.querySelector('[data-send-reply="'+CSS.escape(postId)+'"]');if(!ta||!btn)return;const text=ta.value.trim();if(!text)return toast(t('writeReply'));btn.disabled=true;try{await postJson('/api/wall/reply_v249533',{room_id:room(),post_id:postId,owner_token:device(),text,client_key:uid('wallreply_'+postId+'_')});ta.value='';state.selectedId=postId;await loadThread(postId,true)}catch(e){toast(String(e.message||e).includes('replies_disabled')?t('listenDisabled'):t('replyFailed')+': '+String(e.message||e))}finally{btn.disabled=false}}
async function report(postId){try{await postJson('/api/wall/report_v249345',{room_id:room(),owner_token:device(),post_id:postId,reason:'user_report'});toast(t('reportOk'))}catch(e){toast(t('reportFailed'))}}
function closeWall(){state.selectedId='';try{state.socket&&state.socket.close()}catch(e){}state.socket=null;const root=$('ith526AnonymousWall');if(root)root.remove()}
function click(e){const interactive=e.target.closest('button,textarea,input,a');const close=e.target.closest('[data-wall-close]');if(close){e.preventDefault();return closeWall()}const back=e.target.closest('[data-back-all]');if(back){e.preventDefault();state.selectedId='';return render()}const mode=e.target.closest('[data-compose-mode]');if(mode){e.preventDefault();return setMode(mode.dataset.composeMode)}const filter=e.target.closest('[data-wall-mode-filter]');if(filter){e.preventDefault();state.filter=filter.dataset.wallModeFilter;document.querySelectorAll('[data-wall-mode-filter]').forEach(x=>x.classList.toggle('active',x===filter));state.selectedId='';return render()}const send=e.target.closest('#ith534WallSend');if(send){e.preventDefault();return sendPost()}const reply=e.target.closest('[data-send-reply]');if(reply){e.preventDefault();return sendReply(reply.dataset.sendReply)}const loadBtn=e.target.closest('[data-load-thread]');if(loadBtn){e.preventDefault();return loadThread(loadBtn.dataset.loadThread,true)}const reactBtn=e.target.closest('[data-r10f5-react]');if(reactBtn){e.preventDefault();e.stopPropagation();return react(reactBtn)}const rep=e.target.closest('[data-r10f5-report]');if(rep){e.preventDefault();e.stopPropagation();return report(rep.dataset.r10f5Report)}const open=e.target.closest('[data-open-discussion]');if(open){e.preventDefault();e.stopPropagation();return openDiscussion(open.dataset.openDiscussion)}const card=e.target.closest('[data-open-card]');if(card&&!interactive){e.preventDefault();return openDiscussion(card.dataset.openCard)}}
function keydown(e){const card=e.target.closest('[data-open-card]');if(card&&(e.key==='Enter'||e.key===' ')){e.preventDefault();openDiscussion(card.dataset.openCard)}}
function shellHtml(){return '<div class="ith534Aurora"></div><header class="ith534Head"><button type="button" data-wall-close aria-label="'+esc(t('back'))+'">‹</button><div><small>'+esc(t('safe'))+'</small><h1>'+esc(t('title'))+'</h1><p>'+esc(t('subtitle'))+'</p></div><span class="ith534Live"><i></i><b id="ith534WallLive">0</b> '+esc(t('live'))+'</span><button type="button" data-wall-close aria-label="'+esc(t('close'))+'">×</button></header><nav class="ith534Filters" aria-label="Wall filters"><button class="'+(state.filter==='all'?'active':'')+'" type="button" data-wall-mode-filter="all">'+esc(t('all'))+'</button><button class="'+(state.filter==='listen'?'active':'')+'" type="button" data-wall-mode-filter="listen">'+esc(t('listenFilter'))+'</button><button class="'+(state.filter==='discussion'?'active':'')+'" type="button" data-wall-mode-filter="discussion">'+esc(t('discussionFilter'))+'</button></nav><main id="ith534WallList" class="ith534WallList"><section class="ith534Empty">'+esc(t('loading'))+'</section></main><footer class="ith534Composer"><div class="ith534ModePicker"><button type="button" data-compose-mode="listen"><b>'+esc(t('composeListen'))+'</b><small>'+esc(t('composeListenSub'))+'</small></button><button type="button" data-compose-mode="discussion"><b>'+esc(t('composeDiscussion'))+'</b><small>'+esc(t('composeDiscussionSub'))+'</small></button></div><div id="ith534ModeHint" class="ith534ModeHint"></div><div class="ith534ComposeRow"><textarea id="ith534WallText" maxlength="500" placeholder="'+esc(t('postPlaceholder'))+'"></textarea><button id="ith534WallSend" type="button" aria-label="Send">➤</button></div><div class="ith534ComposeMeta"><span>'+esc(t('anonymousSeparate'))+'</span><b id="ith534WallCount">0/500</b></div></footer>'}
function rebuild(root){if(!root)return;state.lang=lang();const oldText=$('ith534WallText')?.value||'';const oldReply=state.selectedId?document.querySelector('[data-reply-text="'+CSS.escape(state.selectedId)+'"]')?.value||'':'';root.innerHTML=shellHtml();const ta=$('ith534WallText');if(ta){ta.value=oldText;ta.addEventListener('input',()=>{const c=$('ith534WallCount');if(c)c.textContent=ta.value.length+'/500'})}setMode(state.mode);render();if(oldReply&&state.selectedId){const rt=document.querySelector('[data-reply-text="'+CSS.escape(state.selectedId)+'"]');if(rt)rt.value=oldReply}}
function upgrade(root){if(!root)return;if(root.dataset.wallOwnerR10f5==='1'){if(state.lang!==lang())rebuild(root);return}const fresh=root.cloneNode(false);fresh.id='ith526AnonymousWall';fresh.dataset.wallOwnerR10f4='1';fresh.dataset.wallOwnerR10f5='1';fresh.className='ith534WallRoot';root.replaceWith(fresh);state.root=fresh;state.lang=lang();try{state.mode=localStorage.getItem('ith533_wall_mode')==='discussion'?'discussion':'listen'}catch(e){state.mode='listen'}fresh.innerHTML=shellHtml();fresh.addEventListener('click',click,true);fresh.addEventListener('keydown',keydown,true);const ta=$('ith534WallText');if(ta)ta.addEventListener('input',()=>{const c=$('ith534WallCount');if(c)c.textContent=ta.value.length+'/500'});setMode(state.mode);load().catch(e=>{const list=$('ith534WallList');if(list)list.innerHTML='<section class="ith534Empty"><b>'+esc(t('wallFailed'))+'</b><small>'+esc(e.message||e)+'</small></section>'});connect()}
function connect(){try{state.socket&&state.socket.close();const base=api('').replace(/^http:/,'ws:').replace(/^https:/,'wss:');state.socket=new WebSocket(base+'/ws/live_v249345');state.socket.onmessage=e=>{try{const m=JSON.parse(e.data);if(m.room_id&&m.room_id!==room())return;if(m.type==='wall_post_v249533'||m.type==='wall_reply_v249533')setTimeout(()=>{const keep=state.selectedId;load().then(()=>{if(keep){state.selectedId=keep;render()}})},80)}catch(_){}};state.socket.onclose=()=>{if($('ith526AnonymousWall'))setTimeout(connect,2400)}}catch(e){}}
function css(){if($('ith534WallStyle'))return;const s=document.createElement('style');s.id='ith534WallStyle';s.textContent=`
html[data-ithaki-v249526r10f4] #ith526AnonymousWall.ith534WallRoot{visibility:visible!important;display:grid!important;grid-template-rows:auto auto 1fr auto!important;position:fixed!important;inset:0!important;z-index:2147482000!important;background:var(--bg,#06131f)!important;color:var(--text,#eef7ff)!important}.ith534WallRoot *{box-sizing:border-box}.ith534Aurora{position:absolute;inset:-25%;pointer-events:none;background:radial-gradient(circle at 15% 10%,rgba(85,215,255,.20),transparent 28%),radial-gradient(circle at 86% 22%,rgba(54,240,160,.15),transparent 30%),radial-gradient(circle at 50% 92%,rgba(255,211,110,.14),transparent 28%);filter:blur(38px)}.ith534Head{position:relative;z-index:3;display:flex;align-items:center;gap:10px;padding:max(13px,env(safe-area-inset-top)) 12px 11px;background:color-mix(in srgb,var(--bg,#06131f) 92%,transparent);border-bottom:1px solid var(--line,rgba(255,255,255,.12));backdrop-filter:blur(22px)}.ith534Head>div{flex:1;min-width:0}.ith534Head h1{margin:1px 0;color:var(--gold,#ffd36e);font-size:clamp(20px,4.5vw,31px)}.ith534Head p,.ith534Head small{margin:0;color:var(--muted,#a8b9c8)}.ith534Head>button{width:42px;height:42px;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:14px;background:rgba(255,255,255,.07);color:var(--text,#eef7ff);font-size:24px}.ith534Live{display:flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid color-mix(in srgb,var(--green,#36f0a0) 45%,transparent);border-radius:99px;background:rgba(54,240,160,.10);font-size:12px}.ith534Live i{width:8px;height:8px;border-radius:50%;background:var(--green,#36f0a0)}.ith534Filters{position:relative;z-index:3;display:flex;gap:8px;overflow:auto;padding:10px 12px;background:color-mix(in srgb,var(--bg,#06131f) 88%,transparent);border-bottom:1px solid var(--line,rgba(255,255,255,.12))}.ith534Filters button{white-space:nowrap;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:999px;background:rgba(255,255,255,.06);color:var(--text,#eef7ff);padding:9px 13px}.ith534Filters button.active{background:rgba(54,240,160,.15);border-color:var(--green,#36f0a0);color:var(--text,#eef7ff)}.ith534WallList{position:relative;z-index:2;overflow:auto;padding:14px 12px 230px;display:flex!important;flex-direction:column!important;gap:16px!important;align-items:stretch!important}.ith534WallCard{width:min(100%,920px);margin:0 auto;padding:16px;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:23px;background:linear-gradient(180deg,rgba(255,255,255,.075),rgba(255,255,255,.035));box-shadow:0 18px 50px rgba(0,0,0,.22);color:var(--text,#eef7ff)}.ith534WallCard.listen{border-left:4px solid var(--blue,#55d7ff)}.ith534WallCard.discussion{border-left:4px solid var(--green,#36f0a0)}.ith534WallCard.selectable{cursor:pointer}.ith534WallCard.selectable:focus-visible{outline:3px solid var(--gold,#ffd36e);outline-offset:3px}.ith534WallCard>header{display:flex;align-items:center;gap:9px}.ith534WallCard>header>div{display:flex;flex:1;flex-direction:column;min-width:0}.ith534WallCard>header small{color:var(--muted,#a8b9c8)}.ith534WallCard>header>button{border:0;background:transparent;color:var(--muted,#a8b9c8);font-size:19px}.ith534Avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;font-size:23px;background:rgba(85,215,255,.13);border:1px solid var(--line,rgba(255,255,255,.12))}.ith534Mode{font-size:11px;font-weight:800;padding:6px 9px;border-radius:999px;border:1px solid var(--line,rgba(255,255,255,.12));white-space:nowrap}.ith534Mode.listen{color:var(--blue,#55d7ff);border-color:var(--blue,#55d7ff)}.ith534Mode.discussion{color:var(--green,#36f0a0);border-color:var(--green,#36f0a0)}.ith534PostText{font-size:16px;line-height:1.6;white-space:pre-wrap;margin:15px 0}.ith534Reactions{display:flex;gap:7px;flex-wrap:wrap}.ith534Reactions button{display:flex;align-items:center;gap:5px;border:1px solid var(--line,rgba(255,255,255,.12));background:rgba(255,255,255,.055);color:var(--text,#eef7ff);border-radius:99px;padding:7px 9px}.ith534Reactions button.active{background:rgba(255,211,110,.16);border-color:var(--gold,#ffd36e)}.ith534Reactions i{font-style:normal;font-size:11px;color:var(--muted,#a8b9c8)}.ith534ListenOnly{margin-top:14px;padding:12px 13px;border-radius:15px;border:1px solid var(--blue,#55d7ff);background:rgba(85,215,255,.08);display:flex;flex-direction:column;gap:4px}.ith534ListenOnly span{font-size:13px;color:var(--muted,#a8b9c8)}.ith534OpenDiscussion{margin-top:14px;width:100%;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px;text-align:left;border:1px solid var(--green,#36f0a0);border-radius:15px;background:rgba(54,240,160,.10);color:var(--text,#eef7ff);padding:9px 11px}.ith534OpenDiscussion b{color:var(--gold,#ffd36e)}.ith534OpenDiscussion small{color:var(--muted,#a8b9c8)}.ith534Focus{width:min(100%,920px);margin:0 auto}.ith534BackAll{display:flex;align-items:center;gap:6px;margin:0 0 12px;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:14px;background:rgba(255,255,255,.06);color:var(--text,#eef7ff);padding:9px 12px}.ith534WallCard.focused{box-shadow:0 0 0 1px rgba(54,240,160,.18),0 22px 65px rgba(0,0,0,.3)}.ith534Thread{margin-top:15px;padding:13px;border-radius:18px;border:1px solid var(--green,#36f0a0);background:rgba(54,240,160,.055)}.ith534Thread>header{display:flex;align-items:center;gap:10px;margin-bottom:10px}.ith534Thread>header>div{display:flex;flex:1;flex-direction:column}.ith534Thread>header b{color:var(--gold,#ffd36e)}.ith534Thread>header small{color:var(--muted,#a8b9c8)}.ith534Thread>header button{border:1px solid var(--line,rgba(255,255,255,.12));background:rgba(255,255,255,.06);color:var(--text,#eef7ff);border-radius:12px;padding:8px 10px}.ith534ReplyList{display:flex;flex-direction:column;gap:8px}.ith534Reply{padding:11px 12px;border-radius:14px;background:rgba(255,255,255,.055);border-left:3px solid var(--green,#36f0a0)}.ith534Reply header{display:flex;gap:8px;align-items:center}.ith534Reply header b{flex:1;font-size:13px;color:var(--gold,#ffd36e)}.ith534Reply header small{color:var(--muted,#a8b9c8);font-size:11px}.ith534Reply p{margin:7px 0 0;line-height:1.5;white-space:pre-wrap}.ith534NoReplies{padding:12px;border-radius:13px;border:1px dashed var(--line,rgba(255,255,255,.12));color:var(--muted,#a8b9c8);font-size:13px}.ith534ReplyComposer{display:flex;align-items:flex-end;gap:7px;margin-top:10px;padding:7px;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:16px;background:rgba(255,255,255,.045)}.ith534ReplyComposer textarea{flex:1;min-height:48px;max-height:110px;resize:vertical;border:0;outline:0;background:transparent;color:var(--text,#eef7ff);padding:8px;font:inherit}.ith534ReplyComposer button{width:40px;height:40px;flex:0 0 40px;border:0;border-radius:13px;background:var(--green,#36f0a0);color:#071321;font-size:20px;font-weight:900}.ith534Composer{position:absolute;z-index:6;left:0;right:0;bottom:0;padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:color-mix(in srgb,var(--bg,#06131f) 94%,transparent);border-top:1px solid var(--line,rgba(255,255,255,.12));backdrop-filter:blur(23px)}.ith534ThreadOpen .ith534Filters,.ith534ThreadOpen .ith534Composer{display:none!important}.ith534ThreadOpen .ith534WallList{padding-bottom:30px}.ith534ModePicker{display:grid;grid-template-columns:1fr 1fr;gap:8px}.ith534ModePicker button{display:flex;flex-direction:column;gap:3px;text-align:left;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:15px;background:rgba(255,255,255,.055);color:var(--text,#eef7ff);padding:10px 12px}.ith534ModePicker button small{color:var(--muted,#a8b9c8)}.ith534ModePicker button.active{background:rgba(54,240,160,.13);border-color:var(--green,#36f0a0)}.ith534ModeHint{font-size:11px;color:var(--muted,#a8b9c8);padding:6px 2px}.ith534ComposeRow{display:flex;gap:8px}.ith534ComposeRow textarea{flex:1;min-height:50px;max-height:100px;resize:none;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:16px;background:rgba(255,255,255,.055);color:var(--text,#eef7ff);padding:12px;font:inherit}.ith534ComposeRow button{width:54px;border:0;border-radius:16px;background:var(--green,#36f0a0);color:#071321;font-size:23px;font-weight:900}.ith534ComposeMeta{display:flex;justify-content:space-between;margin-top:5px;font-size:11px;color:var(--muted,#a8b9c8)}.ith534Empty{width:min(100%,920px);min-height:220px;margin:0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:7px;border:1px dashed var(--line,rgba(255,255,255,.12));border-radius:22px;background:rgba(255,255,255,.035)}.ith534Empty>span{font-size:48px}@media(max-width:680px){.ith534Head p{display:none}.ith534Live{display:none}.ith534Mode{max-width:125px;overflow:hidden;text-overflow:ellipsis}.ith534WallList{padding-inline:8px}.ith534WallCard{padding:13px}.ith534Composer{padding-inline:8px}.ith534OpenDiscussion{grid-template-columns:auto 1fr}.ith534OpenDiscussion small{grid-column:2}}
`;document.head.appendChild(s)}
function scan(){css();const root=$('ith526AnonymousWall');if(root)upgrade(root);else{state.root=null;if(state.socket){try{state.socket.close()}catch(e){}state.socket=null}}}
function languageRefresh(){const next=lang();if(next!==state.lang&&state.root&&state.root.isConnected)rebuild(state.root)}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',()=>{css();scan()},{once:true});else{css();scan()}
new MutationObserver(()=>{clearTimeout(scan._t);scan._t=setTimeout(()=>{scan();languageRefresh()},0)}).observe(document.documentElement,{childList:true,subtree:true,attributes:true,attributeFilter:['lang','data-ithaki-v249463-language','data-ithaki-v249474-lang']});
window.addEventListener('storage',languageRefresh);window.addEventListener('pageshow',scan);window.addEventListener('ithaki:page-changed',scan);window.addEventListener('ithaki:language-changed',languageRefresh);window.addEventListener('ithaki:lang-changed',languageRefresh);
})();
