/* OK ITHAKI V249442 — isolated Nearby emergency neighborhood.
   Networking never runs in the MainActivity/WebView process and never starts at application boot. */
(function(){
'use strict';
if(window.__ITHAKI_V249442_NEIGHBORHOOD__)return;
window.__ITHAKI_V249442_NEIGHBORHOOD__={version:'V249442-isolated-nearby-emergency-neighborhood'};
function bridge(){return window.OKITHAKI_ANDROID||window.AndroidBridge||null}
function toast(msg){try{if(window.ITH&&typeof ITH.toast==='function')return ITH.toast(msg);if(typeof window.toast==='function')return window.toast(msg)}catch(e){}console.warn(msg)}
function closePlus(){try{const p=document.getElementById('plusSheet');if(p){p.classList.remove('show','ithPlusMenuV249429');p.innerHTML=''}}catch(e){}}
function webInfo(){
  let old=document.getElementById('ithNearbyInfoV249442');if(old)old.remove();
  const o=document.createElement('div');o.id='ithNearbyInfoV249442';o.style.cssText='position:fixed;inset:0;z-index:2147483647;background:rgba(2,8,16,.97);display:grid;place-items:center;padding:18px;color:#fff';
  o.innerHTML='<div style="width:min(620px,96vw);max-height:90vh;overflow:auto;background:#0b1725;border:1px solid rgba(255,218,125,.45);border-radius:24px;padding:20px;box-shadow:0 28px 90px #000">'
    +'<button id="ithNearbyCloseV249442" style="float:right;border:0;border-radius:999px;background:#24384c;color:#fff;width:42px;height:42px;font-size:22px">×</button>'
    +'<h2>🛜 Γειτονιά έκτακτης ανάγκης</h2><p>Η πραγματική επικοινωνία χωρίς internet λειτουργεί μόνο μέσα στο Android APK V249442.</p>'
    +'<p>Στο APK ανοίγει ξεχωριστή ασφαλής οθόνη και ξεχωριστή διεργασία. Χρησιμοποιεί Bluetooth, BLE και Wi‑Fi μέσω Nearby Connections και δεν μπορεί να κλείσει την κύρια ΙΘΑΚΗ.</p>'
    +'<p style="color:#ffd98b">Δεν ξεκινά τίποτε αυτόματα. Πάτησε Γειτονιά και μετά Έναρξη.</p></div>';
  document.body.appendChild(o);document.getElementById('ithNearbyCloseV249442').onclick=()=>o.remove();
}
function open(){
  closePlus();const b=bridge();
  if(b&&typeof b.openEmergencyNeighborhoodV249442==='function'){
    try{b.openEmergencyNeighborhoodV249442();return false}catch(e){toast('Δεν άνοιξε η Γειτονιά: '+String(e.message||e));return false}
  }
  webInfo();return false;
}
function install(){
  window.openEmergencyNeighborhoodV249442=open;
  window.openEmergencyOfflineHubV249283=open;
  window.openEmergencyNeighborhoodV249270=open;
  window.openLocalConnection=open;
  window.ITH=window.ITH||{};
  ITH.openEmergencyNeighborhoodV249442=open;
  ITH.openEmergencyOfflineHubV249283=open;
  ITH.openEmergencyNeighborhoodV249270=open;
  ITH.openLocalConnection=open;
  ITH.phoneNodeStart=open;ITH.phoneNodeScan=open;ITH.phoneNodeInbox=open;
}
document.addEventListener('click',function(ev){const t=ev.target&&ev.target.closest&&ev.target.closest('[data-v249429-act="offline"]');if(!t)return;ev.preventDefault();ev.stopImmediatePropagation();open()},true);
install();
let tries=0;const timer=setInterval(()=>{install();if(++tries>30)clearInterval(timer)},300);
window.addEventListener('load',install,{once:false});
})();
