import{n as g}from"./index-BTglIPU2.js?v=1773287522785";import{o as _}from"./alarm-C8du74Vj.js?v=1773287522785";import{u as w}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{g as v}from"./alarm-DLi1oY_0.js?v=1773287522785";import{k as b,R as C,an as x,r as p,$ as A,a8 as y,S as u,ao as k,a0 as d,F as B,j as f}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a6 as L}from"./naive-ui--dJnpVcV.js?v=1773287522785";const R=b({__name:"index",props:k({multiple:{type:Boolean,default:!0}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(c){const{t:a}=C(),{loading:h,setLoading:o}=w(),i=x(c,"value"),s=p([]),r=p([{name:"mail",title:a("Config.Alarm.index_3"),ps:a("Config.Alarm.index_36"),help:"https://www.yakpanel.com/bbs/thread-66183-1-1.html",list:[]},{name:"dingding",title:a("Config.Alarm.index_5"),ps:a("Config.Alarm.index_37"),help:"https://www.yakpanel.com/bbs/thread-108081-1-1.html",list:[]},{name:"weixin",title:a("Config.Alarm.index_6"),ps:a("Config.Alarm.index_38"),help:"https://www.yakpanel.com/bbs/thread-108116-1-1.html",list:[]},{name:"feishu",title:a("Config.Alarm.index_4"),ps:a("Config.Alarm.index_39"),help:"https://www.yakpanel.com/forum/d/16942-yakpanel-how-does-set-lark-or-feishu-notification",list:[]},{name:"tg",title:"Telegram",ps:"Use Telegram to send and receive panel notifications",help:"https://www.yakpanel.com/forum/d/5115-how-to-add-telegram-to-panel-notifications",list:[]}]),m=async()=>{try{o(!0);const{message:l}=await v({refresh:0});s.value=[],g(l)&&(r.value.forEach(e=>{e.list=l.filter(n=>n.sender_type===e.name)}),r.value.forEach(e=>{const n=l.filter(t=>t.used&&t.sender_type===e.name);n.length>0?n.forEach(t=>{s.value.push({label:"".concat(t.data.title," (").concat(e.title,")"),value:t.id})}):s.value.push({label:()=>d(B,null,[e.title,f("["),d("a",{class:"bt-link",onClick:()=>{_({row:e,onRefresh:m})}},[a("Public.Btn.Conf")]),f("]")]),value:e.name,disabled:!0})}))}finally{o(!1)}};return m(),(l,e)=>{const n=L;return A(),y(n,{value:i.value,"onUpdate:value":e[0]||(e[0]=t=>i.value=t),loading:u(h),options:u(s),multiple:l.multiple,"max-tag-count":"responsive",placeholder:l.$t("Config.Alarm.index_86")},null,8,["value","loading","options","multiple","placeholder"])}}});export{R as _};
