function playSelectedLanguage(){
const activeButton=player.querySelector(".vpX9-tabs button.active");
switchLanguage(activeButton?activeButton.dataset.lang:"zh",true);
}
poster.addEventListener("click",playSelectedLanguage);
poster.addEventListener("keydown",function(event){
if(event.key==="Enter"||event.key===" "){event.preventDefault();playSelectedLanguage()}
});
buttons.forEach(button=>button.addEventListener("click",()=>switchLanguage(button.dataset.lang,true)));
const pageURL=window.location.href.split("#")[0];
// 自动用当前 HTML 文件名作为独立计数编号。
// 例如 NewsA.html 与 NewsB.html 会分别从新的浏览数和点赞数开始。
const fileName=decodeURIComponent((window.location.pathname.split("/").pop()||"video").replace(/\.html?$/i,""));
const generatedCounterId=(fileName.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"video");
const counterId=VIDEO_CONFIG.counterId||generatedCounterId;
const likeKey="vpX9-public-liked-"+counterId;
const viewKey="vpX9-public-viewed-"+counterId;
function storageGet(key){try{return window.localStorage.getItem(key)}catch(e){return null}}
function storageSet(key,value){try{window.localStorage.setItem(key,value)}catch(e){/* 隐私模式下仍可正常计数 */}}
let likes=0;
let views=0;
let liked=storageGet(likeKey)==="1";
let viewed=storageGet(viewKey)==="1";
function renderCounters(){likeCount.textContent=String(likes);viewCount.textContent=String(views);likeBox.classList.toggle("liked",liked)}
renderCounters();
async function loadPublicCounters(recordView){
try{
const options=recordView?{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"action=view",cache:"no-store"}:{cache:"no-store"};
const response=await fetch(VIDEO_CONFIG.likesApi+"?video="+encodeURIComponent(counterId)+"&_="+Date.now(),options);
if(!response.ok)throw new Error("HTTP "+response.status);
const data=await response.json();
likes=Math.max(0,parseInt(data.likes||data.count||0,10));
views=Math.max(0,parseInt(data.views||0,10));
if(recordView){viewed=true;storageSet(viewKey,"1")}
renderCounters();
}catch(error){likeCount.textContent="--";viewCount.textContent="--"}
}
loadPublicCounters(!viewed);
likeButton.addEventListener("click",async function(){
if(liked){showToast(ui().alreadyLiked);return}
likeButton.disabled=true;
try{
const response=await fetch(VIDEO_CONFIG.likesApi+"?video="+encodeURIComponent(counterId),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"action=like",cache:"no-store"});
if(!response.ok)throw new Error("HTTP "+response.status);
const data=await response.json();
likes=Math.max(0,parseInt(data.likes||data.count||0,10));
views=Math.max(0,parseInt(data.views||views,10));liked=true;
storageSet(likeKey,"1");renderCounters();
}catch(error){showToast(ui().likeFailed)}
finally{likeButton.disabled=false}
});
function shareText(){return languageTitle(currentLang)}
function refreshShareLinks(){
player.querySelector(".vpX9-share-x").href="https://twitter.com/intent/tweet?text="+encodeURIComponent(shareText())+"&url="+encodeURIComponent(pageURL);
player.querySelector(".vpX9-share-facebook").href="https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(pageURL);
}
function showToast(message){toast.textContent=message;toast.classList.add("show");setTimeout(()=>toast.classList.remove("show"),2200)}
shareButton.addEventListener("click",function(event){event.stopPropagation();refreshShareLinks();shareMenu.classList.toggle("open")});
player.querySelector(".vpX9-share-wechat").addEventListener("click",async function(){
try{await navigator.clipboard.writeText(pageURL);showToast(ui().copied)}catch(e){window.prompt(ui().copyPrompt,pageURL)}
shareMenu.classList.remove("open");
});
document.addEventListener("click",function(event){if(!shareMenu.contains(event.target)&&event.target!==shareButton)shareMenu.classList.remove("open")});
})();

在纪念牌匾前举行敬献花圈仪式、悼念在巴格达遇难的人员后,古特雷斯表示,联合国驻巴格达总部所在地运河饭店“曾汇聚着一群怀有共同信念的人:即使身处最艰难的环境,人性、团结与希望也必须占据上风”。
他回忆道,其中包括“一位杰出的和平使者”塞尔吉奥·维埃拉·德梅洛;与他并肩工作的,还有“来自不同国家、拥有不同背景,以非凡勇气和奉献精神服务他人的女性和男性”。
秘书长表示,他们留下的精神遗产,“延续在每一位身处冲突、灾难和绝望之中,仍坚持提供援助的人道主义工作者身上”。

伊拉克常驻联合国副代表穆罕默德·马尔祖克表示:“恐怖主义不分国籍、宗教或国界。它与全人类为敌,我们必须以团结、决心和勇气共同应对。”
马尔祖克重申,伊拉克“坚定不移地致力于支持一切减轻人类苦难的努力,并将继续参与我们共同打击恐怖主义的斗争”。他还向“曾经以及目前继续在伊拉克服务的联合国全体工作人员”表达了深切感谢。

此次仪式也纪念了“世界人道主义日”。联合国大会于2008年设立这一纪念日,并将日期定在巴格达爆炸事件发生的同一天。世界人道主义日也向所有在执行人道主义任务期间遇难或受伤的援助工作者致敬。
