1import{r as o,d as w,j as e}from"./react-vendor-CHQL15iE.js";import{u as N,A as $,l as y,T as C}from"./main-Dck1T9BT.js";import{ai as S,J as E,af as g,b as A}from"./lucide-BFLOpGdB.js";import"./pdfjs-ji3DqnKJ.js";import"./markdown-W-rE_H7s.js";import"./katex-math-BxKHCrdI.js";const T=(l,a)=>{let t=l.trim().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return t=t.replace(/^# (.*$)/gm,`<h1 class="${a?"text-base":"text-lg"} md:text-3xl font-black text-slate-800 mb-4 mt-6 border-b-2 border-pink-100 pb-2">$1</h1>`),t=t.replace(/^## (.*$)/gm,`<h2 class="${a?"text-sm":"text-base"} md:text-2xl font-bold text-slate-700 mb-3 mt-5">$1</h2>`),t=t.replace(/^### (.*$)/gm,`<h3 class="${a?"text-xs":"text-sm"} md:text-xl font-bold text-slate-600 mb-2 mt-4">$1</h3>`),t=t.replace(/\*\*(.*?)\*\*/g,'<strong class="font-bold text-pink-600">$1</strong>'),t=t.replace(/^\- (.*$)/gm,'<li class="ml-4 mb-2 flex items-start gap-2"><span class="text-pink-400 mt-1">â¢</span><span>$1</span></li>'),t=t.includes("<li")?`<ul class="my-4 space-y-1">${t}</ul>`.replace(/<\/ul>\n<ul[^>]*>/g,""):t,t=t.replace(/\n\n/g,'<div class="h-4"></div>'),t=t.replace(/---\n/g,'<hr class="my-6 border-slate-100" />'),e.jsx("div",{className:`prose prose-sm md:prose-base prose-pink max-w-none text-slate-600 leading-relaxed ${a?"text-[13px]":""}`,dangerouslySetInnerHTML:{__html:t}})},R=({isOpen:l,onClose:a,language:t})=>{const s=N(),f=s?{WebkitOverflowScrolling:"touch"}:void 0,[i,d]=o.useState("current"),[p,x]=o.useState(null),[k,v]=o.useState([]),[h,m]=o.useState(!1),[c,j]=o.useState($[0]),n=i==="current"?c:p,b=k.filter(r=>r.id!==c.id);return w.useEffect(()=>{l&&(m(!0),y("/api/announcements").then(async r=>{var u;if(!r.ok)throw new Error(`Failed to fetch announcements: ${r.status}`);return(((u=r.headers.get("content-type"))==null?void 0:u.toLowerCase())||"").includes("application/json")?r.json():[]}).then(r=>{Array.isArray(r)&&(v(r),r.length>0&&j(r[0])),m(!1)}).catch(r=>{console.error("Failed to fetch announcements",r),m(!1)}))},[l]),l?e.jsx("div",{className:`fixed inset-0 z-[200] flex items-center justify-center bg-black/40 backdrop-blur-sm animate-fade-in ${s?"p-1.5 overscroll-y-contain touch-pan-y":"p-3 md:p-6"}`,style:s?{paddingTop:"0.75rem",paddingBottom:"0.75rem"}:void 0,onClick:a,children:e.jsxs("div",{className:`bg-white/95 backdrop-blur-xl shadow-[0_20px_60px_rgba(0,0,0,0.3)] border-white ring-pink-100 w-full max-w-3xl flex flex-col overflow-hidden animate-bounce-in ${s?"rounded-[18px] border-[2px] ring-1 h-full max-h-full":"rounded-[20px] md:rounded-[48px] border-[4px] md:border-[10px] ring-2 w-[90%] md:w-full max-h-[85%] md:max-h-[90vh]"}`,onClick:r=>r.stopPropagation(),children:[e.jsxs("main",{className:`${s?"p-2.5":"p-4 md:p-12"} flex-1 min-h-0 overflow-y-auto custom-scrollbar touch-pan-y`,style:f,children:[e.jsxs("div",{className:`${s?"mb-2.5":"mb-4"} flex items-center gap-2`,children:[e.jsx("button",{onClick:()=>{d("current"),x(null)},className:`${s?"px-2.5 py-1 text-[10px]":"px-3 py-1.5 text-xs"} rounded-lg font-black border transition-all ${i==="current"?"bg-pink-500 text-white border-pink-500":"bg-white text-slate-500 border-slate-200 hover:border-pink-200 hover:text-pink-600"}`,children:"ææ°å
¬å"}),e.jsx("button",{onClick:()=>{d("history"),x(null)},className:`${s?"px-2.5 py-1 text-[10px]":"px-3 py-1.5 text-xs"} rounded-lg font-black border transition-all ${i==="history"?"bg-pink-500 text-white border-pink-500":"bg-white text-slate-500 border-slate-200 hover:border-pink-200 hover:text-pink-600"}`,children:"åå²å
¬å"})]}),i==="current"||p?e.jsxs("div",{className:"animate-fade-in",children:[e.jsxs("div",{className:`flex items-center gap-2 text-slate-300 font-black uppercase tracking-[0.2em] ${s?"text-[9px] mb-2.5":"text-[10px] mb-4"}`,children:[e.jsx(S,{size:12}),n==null?void 0:n.date," ⢠V",n==null?void 0:n.id]}),e.jsx("h1",{className:`${s?"text-base mb-3":"text-xl md:text-4xl mb-6 md:mb-8"} font-black text-slate-800 leading-tight drop-shadow-sm`,children:t==="en"&&(n!=null&&n.titleEn)?n.titleEn:n==null?void 0:n.title}),e.jsx("div",{className:`${s?"rounded-xl p-2.5":"rounded-2xl md:rounded-3xl p-4 md:p-8"} bg-slate-50/50 border border-slate-100 shadow-inner`,children:T(t==="en"&&(n!=null&&n.contentEn)?n.contentEn:(n==null?void 0:n.content)||"",s)})]}):e.jsx("div",{className:"grid gap-3 md:gap-4 animate-fade-in",children:h?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(E,{className:"animate-spin text-pink-500",size:32})}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>d("current"),className:`${s?"p-2.5 rounded-[14px]":"p-4 md:p-6 rounded-[20px] md:rounded-[24px]"} bg-pink-50 border-2 border-pink-200 text-left transition-all group flex items-center justify-between shadow-sm relative overflow-hidden`,children:[e.jsx("div",{className:"absolute top-0 right-0 px-3 py-1 bg-pink-500 text-white text-[10px] font-black uppercase tracking-tighter rounded-bl-xl",children:"Latest"}),e.jsxs("div",{children:[e.jsx("div",{className:`${s?"text-[9px] mb-0.5":"text-[10px] mb-1"} font-black text-pink-300 uppercase tracking-widest`,children:c.date}),e.jsx("div",{className:`${s?"text-sm":"text-base md:text-lg"} font-black text-pink-700`,children:c.title})]}),e.jsx("div",{className:"w-8 h-8 md:w-10 md:h-10 bg-white text-pink-500 rounded-lg md:rounded-xl flex items-center justify-center transition-all",children:e.jsx(g,{size:18,className:"md:w-5 md:h-5"})})]}),b.map(r=>e.jsxs("button",{onClick:()=>{d("history"),x(r)},className:`${s?"p-2.5 rounded-[14px]":"p-4 md:p-6 rounded-[20px] md:rounded-[24px]"} bg-white border-2 border-slate-50 hover:border-pink-200 hover:bg-pink-50/30 text-left transition-all group flex items-center justify-between shadow-sm`,children:[e.jsxs("div",{children:[e.jsx("div",{className:`${s?"text-[9px] mb-0.5":"text-[10px] mb-1"} font-black text-slate-300 uppercase tracking-widest`,children:r.date}),e.jsx("div",{className:`${s?"text-sm":"text-base md:text-lg"} font-black text-slate-700 group-hover:text-pink-600 transition-colors`,children:r.title})]}),e.jsx("div",{className:"w-8 h-8 md:w-10 md:h-10 bg-slate-50 group-hover:bg-pink-100 text-slate-300 group-hover:text-pink-500 rounded-lg md:rounded-xl flex items-center justify-center transition-all",children:e.jsx(g,{size:18,className:"md:w-5 md:h-5"})})]},r.id)),b.length===0&&!h&&e.jsx("p",{className:"text-center py-10 text-slate-400 font-bold italic",children:"No archived announcements."})]})})]}),e.jsx("footer",{className:`${s?"p-2.5":"p-4 md:p-10"} pt-0 flex justify-center`,style:s?{paddingBottom:"max(0.75rem, env(safe-area-inset-bottom))"}:void 0,children:e.jsxs("button",{onClick:a,className:`${s?"px-5 py-2.5 text-sm gap-2 rounded-xl":"px-8 md:px-12 py-3 md:py-5 text-base md:text-xl gap-3 rounded-2xl md:rounded-[20px]"} w-full md:w-auto bg-gradient-to-r from-pink-500 to-rose-600 text-white font-black shadow-xl shadow-pink-100 hover:scale-[1.02] active:scale-95 transition-all flex items-center justify-center group touch-manipulation`,children:[e.jsx(A,{size:20,className:"md:w-6 md:h-6 group-hover:scale-110 transition-transform"}),e.jsx("span",{children:C[t].received||"å·²æ¶å°"})]})})]})}):null};export{R as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.