function getCookie(n){for(var c=document.cookie.split(";"),i=0;i(function(){function getCookie(n){for(var c=document.cookie.split(";"),i=0;inull);t&&t.email&&(document.getElementById("headerEmail").textContent=t.email),document.getElementById("authGate").style.display="none",document.getElementById("mainContent").style.display="block",await y()}catch{v()}}function v(){document.getElementById("authGate").style.display="block",document.getElementById("mainContent").style.display="none"}async function h(t,e={}){if(x==="__cookie__"){return fetch(t,{...e,credentials:"include",headers:{"Content-Type":"application/json",...e.headers||{}}}).then(function(r){return r.json()}).then(function(n){if(!n.success)throw new Error(n.message||"API error");return n})}return fetch(t,{...e,headers:{...e.headers||{},"Content-Type":"application/json",Authorization:"Bearer "+x}}).then(function(r){return r.json()}).then(function(n){if(!n.success)throw new Error(n.message||"API error");return n})}async function y(t=!1){t&&(i=[],l=0),document.getElementById("inboxList").innerHTML='