import{b as y,g as l,c as b,w as a,a as s,l as m,t as c,f as h,o as V,j as T,m as M,F as $}from"./index-CTxlYqj4.js";import{l as D}from"./logs-B92gHEZQ.js";import{d as F}from"./index-a9uUi1ey.js";import{V as v,a as S}from"./VToolbar-Cd2iSn8H.js";import{V as C}from"./VTextField-CWm47OUI.js";import{V as I}from"./VDataTableServer-DyIOcZiN.js";import{b as N}from"./VCard-DRptUN8Y.js";import"./tag-Dx3OexMp.js";import"./VAvatar-x_79C0tA.js";import"./VProgressCircular-ubzZW5PC.js";import"./forwardRefs-BSESyuUp.js";import"./ssrBoot-DGgZQEVC.js";import"./VDataTable-CYPG0MtF.js";import"./VSelect-tV4GZAtn.js";import"./VMenu-DTm7W1Hp.js";import"./VCheckboxBtn-xrhfoOlo.js";import"./VSelectionControl-Bdgm37Tl.js";import"./VChip-Def9BYoN.js";import"./VTable-B-HE2nmK.js";import"./filter-DaBUD6Rp.js";const U={__name:"MessageList",setup(k){const{$gettext:t}=y(),d=[{title:t("Queue ID"),key:"queue_id"},{title:t("Date"),key:"date",width:"20%"},{title:t("Status"),key:"status"},{title:t("To"),key:"rcpt"},{title:t("From"),key:"sender"}],p=l(!0),u=l([]),i=l(""),f=l(0);function n({page:o,itemsPerPage:r,sortBy:e,search:w}){let g;e.length&&(g=(e[0].order==="desc"?"-":"")+e[0].key);const x={ordering:g,page:o,page_size:r,search:w};p.value=!0,D.getMessages(x).then(_=>{u.value=_.data.results,f.value=_.data.count,p.value=!1})}return n=F(n,500),(o,r)=>(V(),b(N,{class:"mt-6"},{default:a(()=>[s(I,{headers:d,items:u.value,search:i.value,class:"elevation-0","items-length":f.value,"onUpdate:options":n},{top:a(()=>[s(v,{flat:"",color:"white"},{default:a(()=>[s(C,{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=e=>i.value=e),"prepend-inner-icon":"mdi-magnify",placeholder:h(t)("Search"),variant:"outlined","hide-details":"",density:"compact",class:"flex-grow-0 w-33"},null,8,["modelValue","placeholder"])]),_:1})]),"item.date":a(({item:e})=>[m(c(o.$date(e.date)),1)]),"item.sender":a(({item:e})=>[m(c(o.$truncate(e.sender,50)),1)]),_:2},1032,["items","search","items-length"])]),_:1}))}},j={__name:"MessagesView",setup(k){return(t,d)=>(V(),M($,null,[s(v,{flat:""},{default:a(()=>[s(S,null,{default:a(()=>[m(c(t.$gettext("Message history")),1)]),_:1})]),_:1}),s(h(U))],64))}},ae=T(j,[["__scopeId","data-v-9c91b6c8"]]);export{ae as default};
