import{u as D}from"./vue-router-7f882520.js";import{u as V}from"./vue-i18n-90d534a9.js";import{d as L,b as d,l as T,o as g,c as x,a as o,u,$ as h,bl as v,bc as _,aX as n,P as N,bj as B,_ as R}from"./@vue-cb50a1c4.js";import{l as j,I as F,q as P,L as U,_ as q}from"./index-ae60edf9.js";import"./index-fc073ec7.js";import{S as H}from"./index-7aceb4e5.js";import{a as O}from"./arrows_left-f963ef62.js";import{V as z}from"./virtual-list-b1ee24f1.js";import{_ as E}from"./NomalMessageItem.vue_vue_type_script_setup_true_lang-5a7638a5.js";import"./@intlify-1c0af683.js";import"./open-im-sdk-wasm-f19f04ec.js";import"./dayjs-4460abc8.js";import"./@amap-aca98dec.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"./use-id-22cfdfcf.js";const J="/assets/search_empty-0fa615fa.png",K={class:"page_container !bg-white"},X={class:"flex items-center border-b pl-4"},A=["src"],G={class:"mt-10"},Q={class:"mb-5 text-center text-sm text-sub-text"},W={class:"flex justify-between px-[15vw] text-sm text-primary"},Y={key:0,class:"mt-20 flex flex-col items-center justify-center"},Z=["src"],ee={class:"text-sub-text"},te={class:"mt-3 text-center"},se=L({__name:"index",setup(oe){const m=j(),c=D(),{t:y}=V(),p=d(),r=d(!1),a=d([]),t=T({loading:!1,hasMore:!0,pageIndex:1,count:20}),C=()=>{r.value=!1},w=e=>{e||(r.value=!1)},I=()=>{console.log("onSearch"),r.value=!0,t.pageIndex=1,t.loading=!0;const e={conversationID:m.storeCurrentConversation.conversationID,keywordList:[p.value],keywordListMatchType:0,senderUserIDList:[],messageTypeList:[],searchTimePosition:0,searchTimePeriod:0,pageIndex:t.pageIndex,count:t.count};F.searchLocalMessages(e).then(({data:s})=>{const i=s.searchResultItems?s.searchResultItems[0].messageList:[];t.pageIndex===1?a.value=[...i]:a.value=[...a.value,...i],console.log(a.value),t.pageIndex+=1,t.hasMore=i.length===t.count}).catch(s=>P({message:y("messageTip.searchFailed"),error:s})).finally(()=>t.loading=!1)},b=()=>{c.back()},k=()=>{},f=e=>{c.push({path:"searchMediaMessage",query:{isVideo:e+""}})},M=()=>{c.push("searchFileMessage")},S=e=>{c.push({path:"previewHistoryMessage",state:{conversationID:m.storeCurrentConversation.conversationID,conversationName:m.storeCurrentConversation.showName,jumpMessage:JSON.stringify(e)}})};return(e,s)=>{const i=H,$=U;return g(),x("div",K,[o("div",X,[o("img",{class:"h-[24px] w-[24px]",src:u(O),alt:"",onClick:b},null,8,A),h(i,{modelValue:p.value,"onUpdate:modelValue":[s[0]||(s[0]=l=>p.value=l),w],"show-action":!1,placeholder:e.$t("placeholder.search"),onClear:C,onSearch:I,class:"w-full"},null,8,["modelValue","placeholder"])]),v(o("div",G,[o("div",Q,n(e.$t("findingChatHistory")),1),o("div",W,[o("span",{onClick:M},n(e.$t("documnet")),1),o("span",{onClick:s[1]||(s[1]=l=>f(!1))},n(e.$t("picture")),1),o("span",{onClick:s[2]||(s[2]=l=>f(!0))},n(e.$t("video")),1)])],512),[[_,!r.value]]),r.value&&a.value.length===0&&!t.loading?(g(),x("div",Y,[o("img",{class:"mb-6 h-[76px] w-[125px]",src:u(J),alt:""},null,8,Z),o("span",ee,n(e.$t("noRelevantContent",{keyword:p.value})),1)])):N("",!0),v(o("div",te,[h($,null,{default:B(()=>[R(n(e.$t("searching")),1)]),_:1})],512),[[_,t.loading]]),v(h(u(z),{ref:"vsl",class:"my_scrollbar flex-1 !flex-col overflow-y-auto","data-key":"clientMsgID","data-sources":a.value,bottomThreshold:160,"data-component":E,"estimate-size":88,"extra-props":l=>({onClick:()=>S(l)}),onOnBottom:k},null,8,["data-sources","extra-props"]),[[_,a.value.length>0&&!t.loading]])])}}});const Ne=q(se,[["__scopeId","data-v-e2d718e7"]]);export{Ne as default};
