2025-08-05 21:16:09 +03:30
|
|
|
import{d as x,C as u,dv as G,a2 as M,J as j,k as q,r as _,a1 as J,o as H,y as k,z as d,a3 as K,dF as Q,ae as X,a4 as I,A as l,B as A,u as Y,G as Z,d5 as ee,dG as te,dH as ae,S as re,H as y,F as W,D as se,aj as ne,U as oe,dI as ie}from"./l4qGU2QO.js";import{b as B,c as L,h as F,w as U,m as V,k as le,t as R,l as ue}from"./BtU3wRKV.js";import{s as de}from"./B6xVuD4Y.js";import{B as z}from"./CnoIXQ4P.js";import{U as ce}from"./DjrQXN3k.js";import{_ as ve}from"./B8NUXj0_.js";import{_ as O}from"./DlAUqK2U.js";import"./BqtpcZoZ.js";import"./DWEdiVkG.js";/* empty css */import"./DEzhoBDQ.js";import"./Bq72Mi_i.js";import"./9L842f8O.js";import"./B5y9z2Zl.js";import"./CqHWvl_e.js";import"./IcDXfOe5.js";import"./BN3nLNTV.js";import"./Cd1Zrbp0.js";import"./B1PUzC5B.js";import"./DwTRIgmt.js";const[me,fe]=L("skeleton-title"),he={round:Boolean,titleWidth:B};var _e=x({name:me,props:he,setup(e){return()=>u("h3",{class:fe([{round:e.round}]),style:{width:F(e.titleWidth)}},null)}});const pe=U(_e);var ge=pe;const[we,ye]=L("skeleton-avatar"),ke={avatarSize:B,avatarShape:V("round")};var xe=x({name:we,props:ke,setup(e){return()=>u("div",{class:ye([e.avatarShape]),style:le(e.avatarSize)},null)}});const Se=U(xe);var be=Se;const N="100%",Ce={round:Boolean,rowWidth:{type:B,default:N}},[$e,Te]=L("skeleton-paragraph");var Ie=x({name:$e,props:Ce,setup(e){return()=>u("div",{class:Te([{round:e.round}]),style:{width:e.rowWidth}},null)}});const We=U(Ie);var Be=We;const[Pe,D]=L("skeleton"),Ae="60%",Le={row:ue(0),round:Boolean,title:Boolean,titleWidth:B,avatar:Boolean,avatarSize:B,avatarShape:V("round"),loading:R,animate:R,rowWidth:{type:[Number,String,Array],default:N}};var Ue=x({name:Pe,inheritAttrs:!1,props:Le,setup(e,{slots:i,attrs:s}){const f=()=>{if(e.avatar)return u(be,{avatarShape:e.avatarShape,avatarSize:e.avatarSize},null)},c=()=>{if(e.title)return u(ge,{round:e.round,titleWidth:e.titleWidth},null)},h=o=>{const{rowWidth:t}=e;return t===N&&o===+e.row-1?Ae:Array.isArray(t)?t[o]:t},n=()=>Array(+e.row).fill("").map((o,t)=>u(Be,{key:t,round:e.round,rowWidth:F(h(t))},null)),p=()=>i.template?i.template():u(M,null,[f(),u("div",{class:D("content")},[c(),n()])]);return()=>{var o;return e.loading?u("div",G({class:D({animate:e.animate,round:e.round})},s),[p()]):(o=i.default)==null?void 0:o.call(i)}}});const Ne="data:image/svg+xml,%3csvg%20width='22'%20height='20'%20viewBox='0%200%2022%2020'%20fill='white'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.0031%201H1.00311L8.50311%208.5M21.0031%201L10.5031%2018.5L8.50311%208.5M21.0031%201L8.50311%208.5'%20stroke='%23733af9'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e",Re={class:"message-bubble"},ze={class:"time"},De=x({__name:"Conversation",props:{chatId:{}},setup(e,{expose:i}){const s=e,f=j(),c=q(()=>f.user),h=_([]),n=_(null),p=v=>new Date(v).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});async function o(){if(!s.chatId)return;const v=await Q(s.chatId,1,1e3);h.value=Array.isArray(v)?v:v.data||[]}function t(){n.value&&X(()=>{const v=n.value;v.scrollTo({top:v.scrollHeight,behavior:"smooth"})})}return J(h,()=>{t()}),i({request:o,scrollToBottom:t}),H(async()=>{await o()}),(v,m)=>(d(),k("div",{class:"chat-container",ref_key:"chatContainer",ref:n},[(d(!0),k(M,null,K(h.value,a=>(d(),k("div",{key:a.id,class:I(["message",{sent:a.sender_id===c.value.id,received:a.sender_id!==c.value.id}])},[l("div",Re,[l("p",null,A(a.text),1),l("span",ze,A(p(a.created_at)),1)])],2))),128))],512))}}),Me=O(De,[["__scopeId","data-v-3b999e95"]]),je={class:"flex justify-between items-center w-full p4"},qe={class:"flex items-center gap-5"},He={key:0,class:"flex gap-24px items-center"},Fe={class:"font-semibold flex items-center"},Ve={class:"flex font-200 text-xs items-center"},Oe={dir:"ltr",class:"h-98vh pb-10 overflow-hidden"},Ee=["alt"],Ge=x({__name:"index",setup(e){const i=Y(),s=Z(),f=j(),c=_(""),h=_(null),n=_(void 0);q(()=>{var m,a,g,w;return((a=(m=s.sellerConfig)==null?void 0:m.store)==null?void 0:a.main)&&f.user.id!==((w=(g=s.sellerConfig)==null?void 0:g.store)==null?void 0:w.id)});const p=_(!1),o=_(!1
|