import{D as e,aK as w,c0 as i,r as y,o as b,B as R,b9 as r,bq as c,bV as k,N as x,ah as o,R as C,aI as N,Q as T,I as B,aw as D,K as g,cx as F,dE as H,bb as K}from"./index-CNZMR1GT.js";const L=t=>e(i,{get children(){return t.content}}),V=t=>e(w,{get src(){return t.content}}),W={string:L,image:V},z=()=>{const t=b();y.info(t("manage.messenger-tips"));const[s,l]=R(""),[d,u]=r(()=>c.post("/admin/message/get")),[p,h]=r(()=>c.post("/admin/message/send",{message:s()})),[m,S]=k([]),a=async()=>{const n=await u();F(n,f=>{S(H($=>$.push(f)))})},I=async()=>{const n=await h();K(n)},v=setInterval(a,1e3);return x(()=>clearInterval(v)),e(o,{spacing:"$2",h:"$full",alignItems:"start",get children(){return[e(o,{w:"$full",spacing:"$2",alignItems:"start",p:"$2",rounded:"$lg",border:"1px solid var(--hope-colors-neutral6)",get children(){return[e(i,{size:"xl",get children(){return t("manage.received_msgs")}}),e(C,{each:m,children:n=>e(N,T({get component(){return W[n.type]}},n))})]}}),e(B,{w:"$full",get value(){return s()},onInput:n=>l(n.currentTarget.value)}),e(D,{spacing:"$2",get children(){return[e(g,{colorScheme:"accent",get loading(){return d()},onClick:a,get children(){return t("manage.receive")}}),e(g,{get loading(){return p()},onClick:I,get children(){return t("manage.send")}})]}})]}})};export{z as Messenger,W as Shower,z as default};
