Files
appco_dist/.output/public/_nuxt/BQHc_fkH.js
T

2 lines
6.4 KiB
JavaScript
Raw Normal View History

2026-02-01 21:53:26 +03:30
import{d as g,C as u,de as H,a0 as L,H as N,k as R,r as h,$ as V,o as U,y as c,z as y,a1 as j,dC as E,ae as O,a2 as k,A as l,B as S,u as G,G as J,dh as K,dD as Q,dE as X,F as w,D as W,J as p,S as Y,T as Z,dF as ee}from"./CqMGdh3i.js";import{b as x,c as z,d as b,w as $,k as te,m as D,t as A,l as ae,s as se}from"./DkKOCi34.js";import{_ as re}from"./dOhigEsU.js";import{B as I}from"./h3vOCeO2.js";import{U as ne}from"./C1GbzRtN.js";import{B as oe}from"./Cg4PvGMM.js";import{_ as M}from"./DlAUqK2U.js";import"./DB_tx3mi.js";import"./DMmzgEFm.js";import"./CqL7MJb4.js";import"./DhpIxLUX.js";import"./Bvb2KE_X.js";import"./cVxvsw-g.js";import"./BkdTOo3t.js";import"./B8BNQJT3.js";import"./D6qJbdzf.js";import"./BYO2u26t.js";const[le,ie]=b("skeleton-title"),ue={round:Boolean,titleWidth:x};var ce=g({name:le,props:ue,setup(e){return()=>u("h3",{class:ie([{round:e.round}]),style:{width:z(e.titleWidth)}},null)}});const de=$(ce);var ve=de;const[me,fe]=b("skeleton-avatar"),he={avatarSize:x,avatarShape:D("round")};var _e=g({name:me,props:he,setup(e){return()=>u("div",{class:fe([e.avatarShape]),style:te(e.avatarSize)},null)}});const pe=$(_e);var ge=pe;const T="100%",we={round:Boolean,rowWidth:{type:x,default:T}},[ye,ke]=b("skeleton-paragraph");var xe=g({name:ye,props:we,setup(e){return()=>u("div",{class:ke([{round:e.round}]),style:{width:e.rowWidth}},null)}});const Se=$(xe);var be=Se;const[Ce,P]=b("skeleton"),$e="60%",Te={row:ae(0),round:Boolean,title:Boolean,titleWidth:x,avatar:Boolean,avatarSize:x,avatarShape:D("round"),loading:A,animate:A,rowWidth:{type:[Number,String,Array],default:T}};var Be=g({name:Ce,inheritAttrs:!1,props:Te,setup(e,{slots:i,attrs:a}){const m=()=>{if(e.avatar)return u(ge,{avatarShape:e.avatarShape,avatarSize:e.avatarSize},null)},d=()=>{if(e.title)return u(ve,{round:e.round,titleWidth:e.titleWidth},null)},f=n=>{const{rowWidth:t}=e;return t===T&&n===+e.row-1?$e:Array.isArray(t)?t[n]:t},r=()=>Array(+e.row).fill("").map((n,t)=>u(be,{key:t,round:e.round,rowWidth:z(f(t))},null)),_=()=>i.template?i.template():u(L,null,[m(),u("div",{class:P("content")},[d(),r()])]);return()=>{var n;return e.loading?u("div",H({class:P({animate:e.animate,round:e.round})},a),[_()]):(n=i.default)==null?void 0:n.call(i)}}});const We="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",Ae={class:"message-bubble"},Ie={class:"time"},Pe=g({__name:"Conversation",props:{chatId:{}},setup(e,{expose:i}){const a=e,m=N(),d=R(()=>m.user),f=h([]),r=h(null),_=v=>new Date(v).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});async function n(){if(!a.chatId)return;const v=await E(a.chatId,1,1e3);f.value=Array.isArray(v)?v:v.data||[]}function t(){r.value&&O(()=>{const v=r.value;v.scrollTo({top:v.scrollHeight,behavior:"smooth"})})}return V(f,()=>{t()}),i({request:n,scrollToBottom:t}),U(async()=>{await n()}),(v,o)=>(c(),y("div",{class:"chat-container",ref_key:"chatContainer",ref:r},[(c(!0),y(L,null,j(f.value,s=>(c(),y("div",{key:s.id,class:k(["message",{sent:s.sender_id===d.value.id,received:s.sender_id!==d.value.id}])},[l("div",Ae,[l("p",null,S(s.text),1),l("span",Ie,S(_(s.created_at)),1)])],2))),128))],512))}}),Le=M(Pe,[["__scopeId","data-v-381c0c57"]]),Ne={class:"flex justify-between items-center w-full p4"},Re={class:"flex items-center gap-5"},Ue={key:0,class:"flex gap-24px items-center"},ze={class:"font-semibold flex items-center"},De={class:"flex font-200 text-xs items-center"},Me={dir:"ltr",class:"h-98vh pb-10 overflow-hidden"},qe=["alt"],Fe=g({__name:"index",setup(e){const i=G(),a=J(),m=N(),d=h(""),f=h(null),r=h(void 0);R(()=>a.sellerConfig?.store?.main&&m.user.id!==a.sellerConfig?.store?.id);const _=h(!1),n=h(!1),t=h(void 0);U(async()=>{try{if(_.value=!0,i.currentRoute.value.query?.id?.length){const o=await K(i.currentRoute.value.query?.id);m.user.id===o?.user1_id?r.value=o?.use