const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/index-BGmT8N__.js?v=1773287522785","js/index-BTglIPU2.js?v=1773287522785","js/vue-core-DJjvd5ZC.js?v=1773287522785","js/prismjs-BZPoR7_J.js?v=1773287522785","css/prismjs-D-3FhBe_.css?v=1773287522785","js/naive-ui--dJnpVcV.js?v=1773287522785","css/index-DEM1fxGq.css?v=1773287522785","css/index-C23ge3sx.css?v=1773287522785"])))=>i.map(i=>d[i]); import{_ as se}from"./index-BRQskX9P.js?v=1773287522785";import{w as A,v as N,h as ie,i as G,n as q,ap as z,x as J,P as X,as as re,a3 as de,m as pe,cl as ce}from"./index-BTglIPU2.js?v=1773287522785";import{_ as Z}from"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import{_ as oe}from"./index.vue_vue_type_script_setup_true_lang-HxsqzSKU.js?v=1773287522785";import{_ as F}from"./index.vue_vue_type_script_setup_true_lang-C5hb-Th7.js?v=1773287522785";import{_ as H}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{u as Q}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as Y}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{y as L,z as me,A as ue,B as _e,C as fe,D as be,E as he}from"./mail-COTHIXbY.js?v=1773287522785";import{_ as P}from"./index.vue_vue_type_script_setup_true_lang-DOnYQQHp.js?v=1773287522785";import{k as O,R as T,r as E,e as V,a0 as a,j as y,o as K,$ as I,Z as W,a9 as s,S as t,X as U,aa as B,a3 as ee,b as ge,_ as M,a8 as we}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{au as te,av as ne,B as le,a1 as ye,b as ke,a2 as xe}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{_ as ve}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as Me}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";import"./useLoading-CZ2gSAW7.js?v=1773287522785";const Ee=O({__name:"index",setup(x){const _=ee(()=>X(()=>import("./index-BGmT8N__.js?v=1773287522785"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),{t:l}=T(),b=E(),o=V({p:1,username:null}),{keys:i,table:p,columns:h,setLoading:c}=Y([{type:"selection",width:40},{key:"from",title:l("Mail.Email.index_2"),width:"25%",minWidth:140,ellipsis:{tooltip:!0}},{key:"theme",title:l("Mail.Email.index_3"),minWidth:160,ellipsis:{tooltip:{width:"trigger"}},render:n=>{const u=n.html.replace(/[^\u4e00-\u9fa5]/g,"");return a("span",{class:"cursor-pointer",onClick:()=>{w(n)}},[a("a",{class:"bt-link"},[y(" "),n.subject,y(" ")]),a("span",{class:"text-desc"},[y(" - "),u||n.body])])}},{key:"time",title:l("Mail.Email.index_4"),width:"12%",minWidth:140,render:n=>A(n.time)},Q({width:150,options:n=>[{label:l("Mail.Email.index_5"),onClick:()=>{w(n)}},{label:l("Mail.Email.index_6"),onClick:()=>{v(n)}},{label:l("Public.Btn.Del"),onClick:()=>{f(n)}}]})]),d=[{key:"delete",type:"confirm",label:l("Site.Batch.index_21"),confirm:{title:l("Site.Batch.index_21"),desc:l("Site.Batch.index_11"),columns:[{...h.value[1],width:"auto"}],api:n=>L({path:n.path},!1),done:()=>{g()}}}],r=N(),w=n=>{r.data.row=n,r.title=l("Mail.Email.index_7",[n.subject]),r.show=!0},v=n=>{ie({title:l("Mail.Email.index_8"),content:l("Mail.Email.index_9"),onConfirm:async()=>{await me({path:n.path,username:o.username||""}),g()}})},f=async n=>{await L({path:n.path}),g()},g=async()=>{try{c(!0);const{message:n}=await ue({p:o.p,username:o.username||""});G(n)&&(p.data=q(n.data)?n.data:[],p.total=z(n.page))}finally{c(!1),i.value=[]}},e=()=>{o.p=1,g()};return K(async()=>{await b.value.getList()}),(n,u)=>{const R=ne,C=te,S=H,$=F,D=oe,j=Z,m=J;return I(),W("div",null,[a(j,null,{toolsLeft:s(()=>[a(C,{class:"w-460px"},{default:s(()=>[a(R,null,{default:s(()=>[y(B(n.$t("Mail.Email.index_1")),1)]),_:1}),a(P,{ref_key:"senderRef",ref:b,value:t(o).username,"onUpdate:value":[u[0]||(u[0]=k=>t(o).username=k),e]},null,8,["value"])]),_:1})]),table:s(()=>[a(S,{"row-key":"time","checked-row-keys":t(i),"onUpdate:checkedRowKeys":u[1]||(u[1]=k=>U(i)?i.value=k:null),loading:t(p).loading,data:t(p).data,columns:t(h)},null,8,["checked-row-keys","loading","data","columns"])]),pageRight:s(()=>[a($,{page:t(o).p,"onUpdate:page":u[2]||(u[2]=k=>t(o).p=k),"item-count":t(p).total,onRefresh:g},null,8,["page","item-count"])]),pageLeft:s(()=>[a(D,{"row-key":"time","checked-row-keys":t(i),"onUpdate:checkedRowKeys":u[3]||(u[3]=k=>U(i)?i.value=k:null),data:t(p).data,options:d},null,8,["checked-row-keys","data"])]),_:1}),a(m,{show:t(r).show,"onUpdate:show":u[4]||(u[4]=k=>t(r).show=k),title:t(r).title,data:t(r).data,width:850,height:680,component:t(_)},null,8,["show","title","data","component"])])}}}),Re=O({__name:"index",setup(x){const _=ee(()=>X(()=>import("./index-BGmT8N__.js?v=1773287522785"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),{t:l}=T(),b=E(),o=V({p:1,username:null}),{keys:i,table:p,columns:h,setLoading:c}=Y([{type:"selection",width:40},{key:"from",title:l("Mail.Email.index_2"),width:"25%",minWidth:140,ellipsis:{tooltip:!0}},{key:"theme",title:l("Mail.Email.index_3"),minWidth:160,ellipsis:{tooltip:{width:"trigger"}},render:e=>{const n=e.html.replace(/[^\u4e00-\u9fa5]/g,"");return a("span",{class:"cursor-pointer",onClick:()=>{w(e)}},[a("a",{class:"bt-link"},[e.subject]),a("span",{class:"text-desc"},[y(" - "),n||e.body])])}},{key:"time",title:l("Mail.Email.index_4"),width:"12%",minWidth:140,render:e=>A(e.time)},Q({width:150,options:e=>[{label:l("Mail.Email.index_5"),onClick:()=>{w(e)}},{label:l("Public.Btn.Del"),onClick:()=>{v(e)}}]})]),d=[{key:"delete",type:"confirm",label:l("Site.Batch.index_21"),confirm:{title:l("Site.Batch.index_21"),desc:l("Site.Batch.index_11"),columns:[{...h.value[1],width:"auto"}],api:e=>L({path:e.path},!1),done:()=>{f()}}}],r=N(),w=e=>{r.data.row=e,r.title=l("Mail.Email.index_7",[e.subject]),r.show=!0},v=async e=>{await L({path:e.path}),f()},f=async()=>{try{c(!0);const{message:e}=await _e({p:o.p,username:o.username||""});G(e)&&(p.data=q(e.data)?e.data:[],p.total=z(e.page))}finally{i.value=[],c(!1)}},g=()=>{o.p=1,f()};return K(async()=>{await b.value.getList()}),(e,n)=>{const u=ne,R=te,C=H,S=F,$=oe,D=Z,j=J;return I(),W("div",null,[a(D,null,{toolsLeft:s(()=>[a(R,{class:"w-460px"},{default:s(()=>[a(u,null,{default:s(()=>[y(B(e.$t("Mail.Email.index_1")),1)]),_:1}),a(P,{ref_key:"senderRef",ref:b,value:t(o).username,"onUpdate:value":[n[0]||(n[0]=m=>t(o).username=m),g]},null,8,["value"])]),_:1})]),table:s(()=>[a(C,{"row-key":"time","checked-row-keys":t(i),"onUpdate:checkedRowKeys":n[1]||(n[1]=m=>U(i)?i.value=m:null),loading:t(p).loading,data:t(p).data,columns:t(h)},null,8,["checked-row-keys","loading","data","columns"])]),pageRight:s(()=>[a(S,{page:t(o).p,"onUpdate:page":n[2]||(n[2]=m=>t(o).p=m),"item-count":t(p).total,onRefresh:f},null,8,["page","item-count"])]),pageLeft:s(()=>[a($,{"row-key":"time","checked-row-keys":t(i),"onUpdate:checkedRowKeys":n[3]||(n[3]=m=>U(i)?i.value=m:null),data:t(p).data,options:d},null,8,["checked-row-keys","data"])]),_:1}),a(j,{show:t(r).show,"onUpdate:show":n[4]||(n[4]=m=>t(r).show=m),title:t(r).title,data:t(r).data,width:850,height:680,component:t(_)},null,8,["show","title","data","component"])])}}}),Ce=()=>re.post("/plugin?action=a&name=mail_sys&s=check_rspamd_route",{},{requestOptions:{loading:de.global.t("Component.Pay.index_12"),successMessage:!1}}),Se=O({__name:"index",setup(x){const _=ee(()=>X(()=>import("./index-BGmT8N__.js?v=1773287522785"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),{t:l}=T(),b=E(),o=V({p:1,username:null}),{table:i,columns:p,setLoading:h}=Y([{key:"from",title:l("Mail.Email.index_2"),width:"25%",minWidth:140,ellipsis:{tooltip:!0}},{key:"theme",title:l("Mail.Email.index_3"),minWidth:160,ellipsis:{tooltip:{width:"trigger"}},render:e=>{const n=e.html.replace(/[^\u4e00-\u9fa5]/g,"");return a("span",{class:"cursor-pointer",onClick:()=>{r(e)}},[a("a",{class:"bt-link"},[e.subject]),a("span",{class:"text-desc"},[y(" - "),n||e.body])])}},{key:"time",title:l("Mail.Email.index_4"),width:"12%",minWidth:140,render:e=>A(e.time)},Q({width:150,options:e=>[{label:l("Mail.Email.index_5"),onClick:()=>{r(e)}},{label:l("Mail.Email.index_10"),onClick:()=>{w(e)}},{label:l("Public.Btn.Del"),onClick:()=>{v(e)}}]})]),c=async()=>{try{await Ce(),window.open("/rspamd")}catch(e){pe.error("Please repair the panel before clicking this function")}},d=N(),r=e=>{d.data.row=e,d.title=l("Mail.Email.index_7",[e.subject]),d.show=!0},w=async e=>{await fe({path:e.path,username:o.username||""}),f()},v=async e=>{await L({path:e.path}),f()},f=async()=>{try{h(!0);const{message:e}=await be({p:o.p,username:o.username||""});G(e)&&(i.data=q(e.data)?e.data:[],i.total=z(e.page))}finally{h(!1)}},g=()=>{o.p=1,f()};return K(async()=>{await b.value.getList()}),(e,n)=>{const u=ne,R=te,C=le,S=H,$=F,D=Z,j=J;return I(),W("div",null,[a(D,null,{toolsLeft:s(()=>[a(R,{class:"w-460px"},{default:s(()=>[a(u,null,{default:s(()=>[y(B(e.$t("Mail.Email.index_1")),1)]),_:1}),a(P,{ref_key:"senderRef",ref:b,value:t(o).username,"onUpdate:value":[n[0]||(n[0]=m=>t(o).username=m),g]},null,8,["value"])]),_:1}),a(C,{type:"primary",onClick:c},{default:s(()=>n[3]||(n[3]=[y("Rspamd GUI")])),_:1,__:[3]})]),table:s(()=>[a(S,{loading:t(i).loading,data:t(i).data,columns:t(p)},null,8,["loading","data","columns"])]),pageRight:s(()=>[a($,{page:t(o).p,"onUpdate:page":n[1]||(n[1]=m=>t(o).p=m),"item-count":t(i).total,onRefresh:f},null,8,["page","item-count"])]),_:1}),a(j,{show:t(d).show,"onUpdate:show":n[2]||(n[2]=m=>t(d).show=m),title:t(d).title,data:t(d).data,width:850,height:680,component:t(_)},null,8,["show","title","data","component"])])}}}),$e=async x=>{await ce("/static/ckeditor/ckeditor.js?v=1773287522785"),CKEDITOR.replace(x,{customConfig:"/static/ckeditor/config.js?v1.0"})},ae=()=>CKEDITOR.instances.editor.getData(),De=x=>{CKEDITOR.instances.editor.setData(x)},je=()=>{CKEDITOR.remove(CKEDITOR.instances.editor)},Le={class:"w-350px"},Ue={class:"w-760px"},Be={class:"w-760px"},Oe={class:"text-error"},Ie=O({__name:"index",setup(x){const{t:_}=T(),l=E(),b=E(null),o=V({sender:null,mail_to:"",subject:"",content:""}),i={mail_to:{trigger:["blur","input"],validator:()=>o.mail_to.trim()===""?new Error(_("Mail.Send.index_9")):!0},subject:{trigger:["blur","input"],validator:()=>o.subject.trim()===""?new Error(_("Mail.Send.index_10")):!0},content:{validator:()=>ae()===""?new Error(_("Mail.Send.index_11")):!0}},p=()=>({mail_from:o.sender||"",mail_to:JSON.stringify(o.mail_to.split(",")),subject:o.subject,content:ae(),subtype:"html",smtp_server:"localhost"}),h=async()=>{var d;await((d=b.value)==null?void 0:d.validate());const c=p();await he(c),o.mail_to="",o.subject="",De("")};return K(()=>{$e("editor"),l.value.getList()}),ge(()=>{je()}),(c,d)=>{const r=ye,w=ke,v=le,f=Me,g=ve;return I(),W("div",null,[a(f,{ref_key:"formRef",ref:b,class:"pt-8px",model:t(o),rules:i},{default:s(()=>[a(r,{label:c.$t("Mail.Send.index_1"),path:"sender"},{default:s(()=>[M("div",Le,[a(P,{ref_key:"senderRef",ref:l,value:t(o).sender,"onUpdate:value":d[0]||(d[0]=e=>t(o).sender=e),placeholder:c.$t("Mail.Send.index_2")},null,8,["value","placeholder"])])]),_:1},8,["label"]),a(r,{label:c.$t("Mail.Send.index_3"),path:"mail_to"},{default:s(()=>[M("div",Ue,[a(w,{value:t(o).mail_to,"onUpdate:value":d[1]||(d[1]=e=>t(o).mail_to=e),placeholder:c.$t("Mail.Send.index_4")},null,8,["value","placeholder"])])]),_:1},8,["label"]),a(r,{label:c.$t("Mail.Send.index_5"),path:"subject"},{default:s(()=>[M("div",Be,[a(w,{value:t(o).subject,"onUpdate:value":d[2]||(d[2]=e=>t(o).subject=e),placeholder:""},null,8,["value"])])]),_:1},8,["label"]),a(r,{label:c.$t("Mail.Send.index_6"),path:"content"},{default:s(()=>d[3]||(d[3]=[M("div",{class:"w-760px h-392px"},[M("textarea",{class:"hidden",name:"editor",id:"editor",rows:"10"})],-1)])),_:1,__:[3]},8,["label"]),a(r,{label:" ","show-feedback":!1},{default:s(()=>[a(v,{type:"primary",size:"large",onClick:h},{default:s(()=>[y(B(c.$t("Mail.Send.index_7")),1)]),_:1})]),_:1})]),_:1},8,["model"]),a(g,{class:"ml-24px mt-24px"},{default:s(()=>[M("li",Oe,B(c.$t("Mail.Send.index_8")),1)]),_:1})])}}}),lt=O({__name:"index",setup(x){const _=E("inbox"),l=[{key:"inbox",label:"Inbox",component:Ee},{key:"outbox",label:"Outbox",component:Re},{key:"spam",label:"Spam",component:Se},{key:"sender",label:"Sender",component:Ie}];return(b,o)=>{const i=se,p=xe;return I(),we(p,{class:"p-16px"},{default:s(()=>[a(i,{value:t(_),"onUpdate:value":o[0]||(o[0]=h=>U(_)?_.value=h:null),options:l},null,8,["value"])]),_:1})}}});export{lt as default};