1import{d as y,T as b,x as f,K as B,J as L,o as c,c as g,a as e,u as t,P as V,Q as k,k as _,l as x,L as w,h as A,F as C,r as T,j as E,n as M,b as N,B as U,W as $}from"./Cn-bPh2x.js";import{c as S}from"./DicXruXG.js";import{u as h}from"./BSsL4GZz.js";import"./DHcOGyuv.js";const{languages:F}=S,I=Object.values(F??{}),j={class:"form-group"},O={class:"form-input"},P=["for"],z=["id"],D={class:"form-group"},J={class:"form-input"},K=["for"],Q=y({__name:"BroadcastMessageEditor",props:{message:{}},emits:["update"],setup(v,{emit:u}){const[r,o]=[b(),b()],d=v,m=u,a=f(d.message);return B(a,n=>{m("update",n)}),(n,s)=>{const p=L("v-select"),i=w;return c(),g("div",null,[e("div",j,[e("div",O,[e("label",{for:t(r)},"Content",8,P),V(e("textarea",{id:t(r),"onUpdate:modelValue":s[0]||(s[0]=l=>t(a).content=l)},null,8,z),[[k,t(a).content]])])]),e("div",D,[e("div",J,[e("label",{for:t(o)},"Locale",8,K),_(i,null,{default:x(()=>[_(p,{modelValue:t(a).locale,"onUpdate:modelValue":s[1]||(s[1]=l=>t(a).locale=l),"input-id":t(o),options:t(I),reduce:l=>l.name,label:"name"},null,8,["modelValue","input-id","options","reduce"])]),_:1})])])])}}}),R={class:"form-group"},W={class:"form-input"},Y=y({__name:"index",setup(v){const{$api:u}=A(),r=f(!1),o=f([{content:"",locale:"English"}]),d=()=>{o.value.push({content:"",locale:"English"})},m=(n,s)=>{o.value[n]=s},a=async()=>{if(confirm("Are you SURE you want to send this message to ALL users?")){r.value=!0;try{await u("/v1/alerts/broadcast",{method:"POST",body:{messages:o.value}}),h({type:"success",message:"Broadcast message sent successfully"})}catch(n){h({type:"error",message:"Failed to send broadcast message"}),console.error(n)}finally{r.value=!1}}};return(n,s)=>(c(),g("div",null,[s[1]||(s[1]=e("h2",null,"Telegram Broadcast",-1)),s[2]||(s[2]=e("p",null," All the message in each language to be sent through Telegram to ALL users. ",-1)),e("form",{onSubmit:$(a,["prevent"]),class:"form form-primary mt-base"},[(c(!0),g(C,null,T(t(o),(p,i)=>(c(),E(Q,{onUpdate:l=>m(i,l),message:p,key:`message-${i}`,class:M(["border-green-500",{"border-t pt-base":i,"pb-base":!i}])},null,8,["onUpdate","message","class"]))),128)),e("div",{class:"form-group"},[e("div",{class:"form-input"},[e("button",{type:"button",onClick:d,class:"block ml-auto link primary-link"}," + add message ")])]),e("div",R,[e("div",W,[_(t(U),{"button-type":"submit",loading:t(r)},{default:x(()=>[...s[0]||(s[0]=[N("Send to all users",-1)])]),_:1},8,["loading"])])])],32)]))}});export{Y 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.