import{d as w,k as M,o as v,c as y,$ as f,u as o,a as m,aX as b,P as L,b as g,l as k,w as N,a_ as x,ar as B,as as P,bl as R,bc as $}from"./@vue-cb50a1c4.js";import{o as E,_ as F,Q as C,l as D,I as H,L as q}from"./index-ae60edf9.js";import{_ as U}from"./index.vue_vue_type_script_setup_true_lang-1170722e.js";import{V}from"./virtual-list-b1ee24f1.js";import{s as z}from"./function-call-5bab1da7.js";import"./vue-router-7f882520.js";import"./open-im-sdk-wasm-f19f04ec.js";import"./dayjs-4460abc8.js";import"./@amap-aca98dec.js";import"./vue-i18n-90d534a9.js";import"./@intlify-1c0af683.js";import"./pinia-de4079f2.js";import"./axios-7d5a0a64.js";import"./form-data-497f8b5e.js";import"./uuid-a960c1f4.js";import"./date-fns-f56f60e6.js";import"./@babel-7fd5df1e.js";import"./mitt-f7ef348c.js";import"./@vueuse-19adab01.js";import"./livekit-client-ca552de3.js";import"./@livekit-3058dbe8.js";import"./loglevel-e40a507a.js";import"./rxjs-2154ddb2.js";import"./tslib-8dbab242.js";import"./@vuemap-5ebdc63e.js";import"./lodash-es-91418b19.js";import"./index-597402db.js";import"./arrows_left-f963ef62.js";const O={class:"flex px-[22px] py-3"},T={class:"flex-1 ml-3 overflow-hidden"},j={class:"mt-2 rounded bg-white px-3 py-2"},A={class:"mt-2 break-all text-xs text-[#000]"},J=["src"],K=w({__name:"NotifyMessageItem",props:{source:null},emits:[],setup(l,{emit:n}){const s=l,t=M(()=>{try{return s.source.senderFaceUrl||""}catch(e){return console.error("Failed to compute senderFaceUrl:",e),""}}),r=M(()=>{try{const e=s.source.notificationElem.detail;return e?JSON.parse(e):{}}catch(e){return console.error("Failed to parse notificationElem.detail:",e),{}}}),c=e=>{if(!e){console.error("Invalid URL:",e);return}z({images:[e],startPosition:0,loop:!1})};return(e,i)=>{var a,u,_,d;return v(),y("div",O,[f(E,{"is-notification":"",src:o(t),size:42},null,8,["src"]),m("div",T,[m("div",j,[m("div",A,b(o(r).text),1),(u=(a=o(r).pictureElem)==null?void 0:a.bigPicture)!=null&&u.url?(v(),y("img",{key:0,class:"mt-2",onClick:i[0]||(i[0]=Z=>{var h,I;return((I=(h=o(r).pictureElem)==null?void 0:h.bigPicture)==null?void 0:I.url)&&c(o(r).pictureElem.bigPicture.url)}),src:(d=(_=o(r).pictureElem)==null?void 0:_.bigPicture)==null?void 0:d.url,alt:"Preview Image"},null,8,J)):L("",!0)])])])}}});const Q=F(K,[["__scopeId","data-v-98e4a170"]]),p=C(),S=D();function X(){const l=g(),n=g(!0),s=g(!1),t=k({loading:!1,lastMinSeq:0}),r=async()=>{if(p.storeHistoryMessageHasMore&&!t.loading){const{messageIDList:i,lastMinSeq:a}=await c();a&&(t.lastMinSeq=a),t.loading=!1}},c=async()=>{var i;return t.loading=!0,await p.getHistoryMessageListFromReq({conversationID:S.storeCurrentConversation.conversationID,userID:"",groupID:"",count:20,startClientMsgID:((i=p.storeHistoryMessageList[0])==null?void 0:i.clientMsgID)??"",lastMinSeq:t.lastMinSeq})},e=()=>{!l.value||!n.value||(n.value=!1)};return N(()=>S.storeCurrentConversation.conversationID,async()=>{n.value=!0,p.resetHistoryMessageList(),s.value=!0,await c(),s.value=!1},{immediate:!0}),{vsl:l,historyNotificationInitLoading:s,onToBottom:r,onItemRendered:e}}const G={class:"page_container"},W={class:"relative flex-1 overflow-hidden"},Y={class:"!absolute top-0 flex h-full w-full items-center justify-center bg-white"},Le=w({__name:"index",setup(l){const n=C(),s=D(),t=X(),{onItemRendered:r,onToBottom:c}=t,e=x(t,"vsl"),i=x(t,"historyNotificationInitLoading"),a=()=>{s.storeCurrentConversation.unreadCount>0&&H.markConversationMessageAsRead(s.storeCurrentConversation.conversationID)};return B(()=>{a()}),P(()=>{a()}),(u,_)=>{const d=q;return v(),y("div",G,[f(U,{title:u.$t("notification")},null,8,["title"]),m("div",W,[f(o(V),{ref_key:"vsl",ref:e,class:"my_scrollbar h-full !flex-col overflow-y-auto","data-key":"clientMsgID","data-sources":o(n).storeHistoryMessageList,bottomThreshold:160,"data-component":Q,"estimate-size":88,onOnBottom:o(c),onResized:o(r)},null,8,["data-sources","onOnBottom","onResized"]),R(m("div",Y,[f(d,{type:"spinner"})],512),[[$,o(i)]])])])}}});export{Le as default};
