import{ao as y,af as D,z as L,D as k,I as v,F as x,m as c,g as i,o as m,p as A,ai as E}from"./index-DpP8vbvu.js";import{u as C}from"./email-BqixZxSP.js";import{e as T}from"./index-v7AaNdhX.js";import{a as b,b as R,c as j}from"./email-CsVstZMr.js";import{s as B,a as z}from"./star-DxhhrwZA.js";import{s as F}from"./time-utils-B0cDvgwY.js";import{I as d}from"./iconify-CxZjXnJf.js";import"./el-scrollbar-DIXSy-7M.js";import"./index-BMdPKuCq.js";import"./el-empty-BRrnteWe.js";import"./index-D7KcZu8a.js";import"./el-tooltip-l0sNRNKZ.js";import"./el-tag-CjAzCWMf.js";import"./vnode-DPqF99Zc.js";import"./event-BB_Ol6Sd.js";import"./index-dQfRzLGT.js";import"./el-checkbox-DjYzjb3f.js";import"./index-Bm-x70H-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./day-B6NtfdPE.js";import"./dayjs.min-BjOfKEma.js";/* empty css                       *//* empty css                  *//* empty css                 */import"./index-CcAtbSPY.js";import"./index-BWeK8p2T.js";import"./position-5hNBDW7r.js";import"./throttle-BCwYugI2.js";const pt=Object.assign({name:"email"},{__name:"index",setup(J){const e=C(),s=y(),n=D(),o=L({}),r=k({timeSort:0});v(()=>{e.emailScroll=o,h()}),x(()=>s.currentAccountId,()=>{o.value.refreshList()});function l(){r.timeSort=r.timeSort?0:1,o.value.refreshList()}function f(t){e.contentData.email=t,e.contentData.delType="logic",e.contentData.showStar=!0,e.contentData.showReply=!0,E.push("/message")}const S=new Set;async function h(){for(;;){const t=o.value.latestEmail?.emailId||0;if(!o.value.firstLoad&&n.settings.autoRefreshTime)try{const a=s.currentAccountId,_=r.timeSort,u=await b(t,a);a===s.currentAccountId&&r.timeSort===_&&u.length>0&&u.forEach(p=>{S.add(p.emailId),o.value.addItem(p)})}catch(a){console.error(a)}await F(n.settings.autoRefreshTime*1e3)}}function g(t){e.starScroll?.addItem(t)}function I(t){e.starScroll?.deleteEmail([t.emailId])}function w(t,a){return j(s.currentAccountId,t,r.timeSort,a,0)}return(t,a)=>(m(),c(T,{ref_key:"scroll",ref:o,"cancel-success":I,"star-success":g,getEmailList:w,emailDelete:i(R),"star-add":i(z),"star-cancel":i(B),"time-sort":r.timeSort,actionLeft:"4px",onJump:f},{first:A(()=>[r.timeSort===0?(m(),c(i(d),{key:0,class:"icon",onClick:l,icon:"material-symbols-light:timer-arrow-down-outline",width:"28",height:"28"})):(m(),c(i(d),{key:1,class:"icon",onClick:l,icon:"material-symbols-light:timer-arrow-up-outline",width:"28",height:"28"}))]),_:1},8,["emailDelete","star-add","star-cancel","time-sort"]))}});export{pt as default};
