PageSourceSearch

https://erobella.com/_nuxt/BzlRe2Qc.js

js erobella.com collected 2026-09-24 10:05:21 UTC 100,121 bytes, 1 lines download raw bytes

1import{u as hn}from"./DkR42Mzh.js";import{a4 as Ot,Z as Bt,ax as Be,a7 as yt,r as C,af as qt,aQ as Kt,c as W,F as xe,aG as ue,q as ze,ba as Dt,v as fn,a0 as Qe,a8 as Ee,f as Ve,d7 as vn,d as Pe,o as s,k as ee,w as Oe,b as J,a as n,t as o,e as t,j as e,R as _e,n as O,l as d,Q as ae,K as He,b5 as Fe,O as Ut,bb as Ps,bc as Ns,B as pn,m as ie,M as Ne,aw as gn,bg as _n,b4 as Vt,aI as Yt,V as Is,W as Ls,bf as mn,d8 as bn,b8 as yn,b9 as wn,aq as Et,ap as Ds,D as Us,aO as Ht,a2 as Ft,aV as kn,bd as $n,_ as Cn}from"./-6Lls737.js";import{l as Mn,m as zt,u as Es,_ as Rs,M as Rt,a as Sn,b as Tn,c as jn,d as Dn,e as Un,f as En,h as As,i as Gs,j as Hs,g as On,k as Os}from"./TToVuD9r.js";import{u as Bs}from"./CXnfTPfL.js";import{_ as Wt}from"./C2j6UuSi.js";import{_ as Bn,a as Vn,M as Pn}from"./jKrhmY4U.js";import{_ as Nn}from"./DTkNhqIJ.js";import{_ as In}from"./C9IHJtY7.js";import{_ as Fs}from"./DlAUqK2U.js";import{_ as Ln,a as Rn}from"./uPtXMLvQ.js";import{g as Vs}from"./DOHqYavS.js";import{u as An}from"./DkMiOBSJ.js";import{_ as zs}from"./2fU8BYDP.js";import{u as Ws}from"./OYRUoAmG.js";import{i as Ge}from"./Dn9AdfR4.js";import{u as qs}from"./DG8JnK8j.js";import"./Bf3VUeaX.js";import"./DPW9WYez.js";import"./BTKKQg60.js";import"./B-WMGmDU.js";import"./BjgMM6IP.js";import"./DmcX-yy6.js";import"./B5spvOTL.js";import"./DSV61gAW.js";import"./DekfMc5K.js";function Ks(){const K=Ot(),v=Bt(),{currentUser:b}=Be(v),j=yt(),{conversations:f,loading:L,error:r}=Be(j),D=C(!1),U=C(""),P=async()=>{if(!(typeof window>"u"))try{if(K.query.uid)return await S();sessionStorage.removeItem("pendingConversationUserId"),sessionStorage.removeItem("pendingConversationMessage")}catch(Q){console.error("Error handling pending conversation:",Q)}},S=async()=>{if(K.query.uid)try{D.value=!0,U.value="Checking for existing conversation...";const Q=Number(K.query.uid);f.value.length===0&&await j.fetchConversations();const Y=f.value.find(ne=>{var R,y;return((R=ne.initiator_user)==null?void 0:R.id)===Q||((y=ne.recipient_user)==null?void 0:y.id)===Q});if(Y)return D.value=!1,qt(`/users/account/messages/${Y.id}`);j.setPendingRecipient(Q),D.value=!1}catch(Q){D.value=!1,console.error("Error handling conversation from query params:",Q)}};return{isLoading:D,loadingMessage:U,conversations:f,loading:L,error:r,currentUser:b,handlePendingConversation:P,handleConversationFromQueryParams:S,isInboxEmpty:()=>!L.value.conversations&&f.value.length===0&&!j.hasPendingRecipient,isInMessageThread:()=>!!K.params.id,messageStore:j,userStore:v}}const At=13,Gn=864e5;function Hn(K){const v=Ot(),b=Kt(),j=W(()=>K!=null&&K.value?String(K.value):v.params.id),f=yt(),L=Bt();Mn();const{currentConversation:r,loading:D,isConversationBlocked:U,currentMessages:P}=Be(f),{currentUser:S}=Be(L),H=C(""),se=C(!1),Q=C("image"),Y=C(null),ne=C(null),R=C(!1),y=C(!1),h=C(!1),c=C(!1),m=C(0),N=C(null),F=C(!1),z=C(!1),G=C(null),k=Bs(()=>{f.sendTypingIndicator()},100),$=async()=>{if(!j.value||D.value.loadingEarlier||y.value)return;y.value=!0;const a=Number(j.value),l=f.pagination[a];if(!l||!l.hasMore){y.value=!1;return}const I=Y.value;let V=0,le=0;I&&(V=I.scrollHeight,le=I.scrollTop);try{if(await f.loadEarlierMessages(a),await ue(),I){const Z=I.scrollHeight-V;Z>0&&(I.scrollTop=le+Z)}}catch(ce){console.error("Error loading earlier messages:",ce)}finally{y.value=!1}},w=async()=>{if(R.value)return;R.value=!0,await ue();const a=()=>{Y.value&&(Y.value.scrollTop=Y.value.scrollHeight)};await new Promise(l=>setTimeout(l,0)),a(),await new Promise(l=>setTimeout(l,50)),a(),await new Promise(l=>setTimeout(l,100)),a(),await new Promise(l=>setTimeout(l,150)),a(),await new Promise(l=>setTimeout(l,300)),a(),await new Promise(l=>setTimeout(l,500)),requestAnimationFrame(()=>{a(),setTimeout(()=>{R.value=!1,h.value=!0},50)})},M=Bs(w,200);xe(()=>j.value,async a=>{if(a){h.value=!1,f.unsubscribeFromCurrentChannel();const l=Number(a);f.currentConversationId=l,f.loading.messages=!0,f.isConversationBlocked=!1,await f.fetchConversations(l),await f.fetchMessagesWithPagination(l,20,!0),ue(()=>w())}},{immediate:!0}),xe(()=>P.value,(a,l)=>{if(y.value||!a||a.length===0)return;const I=a.length,V=(l==null?void 0:l.length)||0;if(I>V){const le=a[I-1],ce=l&&V>0?l[V-1]:null;if(!ce||le.id!==ce.id){ue(w);return}}if(I===V&&I>0){const le=a[I-1],ce=l[V-1];if(le.id!==ce.id){ue(w);return}}},{deep:!0}),xe(()=>Y.value,a=>{var l;a&&((l=P.value)==null?void 0:l.length)>0&&w()}),xe(()=>v.name,(a,l)=>
1{typeof a=="string"&&(a==="users-account-messages-id"||a==="users-account-messages-id-index"||typeof l=="string"&&l.includes("media")&&!a.includes("media"))&&ue(w)});const B=a=>{const l=a.detail;l&&l.conversationId===Number(j.value)&&ue(w)};ze(()=>{if(ue(w),window.addEventListener(Dt.TEMP_MESSAGE_ADDED,B),window.addEventListener(Dt.CONTENT_MESSAGE_ADDED,B),Y.value){const a=new MutationObserver(()=>{if(y.value)return;const l=Y.value;if(!l)return;l.scrollHeight-l.scrollTop-l.clientHeight<200&&M()});a.observe(Y.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"],characterData:!1}),window._messageObserver=a}}),fn(()=>{f.currentConversationId=null,f.unsubscribeFromCurrentChannel(),window.removeEventListener(Dt.TEMP_MESSAGE_ADDED,B),window.removeEventListener(Dt.CONTENT_MESSAGE_ADDED,B),window._messageObserver&&(window._messageObserver.disconnect(),window._messageObserver=null)});const oe=W(()=>{var l;return r.value?((l=S.value)==null?void 0:l.id)===r.value.initiator_user.id?r.value.recipient_user:r.value.initiator_user:null}),T=W(()=>{var l,I,V;const a=((V=(I=(l=oe.value)==null?void 0:l.username)==null?void 0:I.toLowerCase())==null?void 0:V.replace(/\s+/g,""))||"";return a==="erobella"||a==="teamerobella"}),he=()=>f.pendingRecipientId!==null?!0:!T.value,me=async()=>{const a=f.pendingRecipientId!==null;if(!H.value.trim()||!j.value&&!a)return;v.name==="users-account-messages-id-media"&&j.value&&(await b.push(`/users/account/messages/${j.value}`),await ue());const l=H.value;H.value="",await f.sendMessage(l),ue(()=>requestAnimationFrame(w))},be=W(()=>{if(!S.value||!P.value)return[];const a=[...P.value];return a.sort((l,I)=>{const V=String(l.id).length>=At,le=String(I.id).length>=At;return V&&!le?1:!V&&le?-1:new Date(l.created_at).getTime()-new Date(I.created_at).getTime()}),a.map(l=>{var p,X;const I=((p=l.user)==null?void 0:p.id)===((X=S.value)==null?void 0:X.id),V=String(l.id).length>=At,le=l.content.match(/Sent (\d+) image[s]* \((\d+) credits\)/),ce=!!le||l.message_type==="image",Z=le?{images:parseInt(le[1]),price:parseInt(le[2])}:null,qe=l.read_sent_time?new Date(l.read_sent_time):new Date(l.created_at),g=qe.toLocaleDateString();return{type:I?"self":"user",date:g,timestamp:qe.getTime(),message:l.content,id:l.id,user:l.user,isTemporary:V,isContentMessage:ce,contentInfo:Z,originalMessage:l}})}),Ce=W(()=>{if(be.value.length===0)return[];const a=[];let l=null,I=null;const V=new Date().toLocaleDateString(),le=new Date(Date.now()-Gn).toLocaleDateString();return be.value.forEach(ce=>{if(ce.date!==l){l=ce.date;let Z;l===V?Z="Today":l===le?Z="Yesterday":Z=l,I={date:l,dateLabel:Z,messages:[]},a.push(I)}I&&I.messages.push(ce)}),a}),Ze=W(()=>{var a;return!((a=P.value)!=null&&a.length)}),A=async()=>{v.name==="users-account-messages-id-media"&&(await b.push(`/users/account/messages/${j.value}`),await ue()),Q.value="image",se.value=!0},ve=async a=>{try{if(z.value=!1,F.value=!0,a.tempVideoId&&G.value){const{sendVideoMessage:l}=zt(),I=G.value.conversationId,{error:V}=await l(I,[a.tempVideoId],a.content,a.price);if(V){Ee.error(V.message||"Failed to send video message"),F.value=!1;return}await f.fetchMessages(I),await ue(),w()}else G.value&&(await f.fetchMessages(G.value.conversationId),await ue(),w())}catch{Ee.error("Failed to send video message")}finally{F.value=!1,c.value=!1,G.value=null}},We=async()=>{var a,l;if((a=G.value)!=null&&a.isTemp&&((l=G.value)!=null&&l.tempVideoId)){const{deleteTempVideo:I}=zt();await I(G.value.conversationId,G.value.tempVideoId)}z.value=!1,c.value=!1,G.value=null},Je=async()=>{typeof window>"u"||(v.name==="users-account-messages-id-media"&&(await b.push(`/users/account/messages/${j.value}`),await ue()),Q.value="video",se.value=!0)},Me=W(()=>!!L.hasRole(Qe.PUNTER)),Se=W(()=>({position:"fixed",top:"0",left:"0",right:"0",zIndex:"30",backgroundColor:"white"}));return{message:H,showContentModal:se,contentModalMediaType:Q,messagesContainer:Y,messageEndRef:ne,isScrolling:R,isLoadingEarlierMessages:y,hasCompletedInitialScroll:h,uploadingVideo:c,uploadProgress:m,uploadError:N,sendingVideoMessage:F,showThumbnailPicker:z,uploadedVideoData:G,currentConversation:r,loading:D,isConversationBlocked:U,currentMessages:P,currentUser:S,otherUser:oe,isInternal:T,formattedMessages:be,messagesByDate:Ce,hasNoMessages:Ze,isUserPunter:Me,mobileHeaderStyle:Se,canMessageBack:he,postMessage:me,loadEarlierMessages:$,scrollToBottom:w,sendTypingIndicator:k,handlePhotoButtonClick:A,handleVideoUpload:Je,handleThumbn
1ailSelected:ve,handleThumbnailCanceled:We,messageStore:f,userStore:L}}const Ys=()=>{const{t:K}=Ve();return{previewFor:(b,j)=>{var L;const f=b.last_message;if(!f)return K("inbox.startConversationPlaceholder");if(f.message_type===vn.TIP){const r=Math.round(Number(f.price??0));return((L=f.user)==null?void 0:L.id)===j?K("account.conversations.tip.previewSent",{amount:r}):K("account.conversations.tip.previewReceived",{amount:r})}return f.content??""}}},Fn=K=>(Ps("data-v-66590e5b"),K=K(),Ns(),K),zn={class:"flex flex-col gap-4"},Wn={class:"flex flex-col gap-4"},qn={class:"flex items-center justify-between mb-2"},Kn={class:"text-sm font-medium"},Yn={class:"text-xs text-gray-500"},Qn={class:"grid grid-cols-3 gap-3"},Zn=["onClick"],Jn=["src","alt","onError"],Xn={key:0,class:"absolute top-1 right-1 bg-x-pink-1 rounded-full w-6 h-6 flex items-center justify-center"},eo=Fn(()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"white","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},[e("polyline",{points:"20 6 9 17 4 12"})],-1)),to=[eo],so={class:"flex flex-col gap-2 mt-4"},no={class:"text-sm text-gray-700"},oo={class:"flex flex-col gap-2 mt-2"},io={class:"text-sm text-gray-700"},lo={class:"text-xs text-gray-500"},ro={key:0},ao={key:1},co=Pe({__name:"VideoThumbnailPicker",props:{conversationId:{},videoId:{},tempVideoId:{},thumbnailOptions:{},initialContent:{},isTemp:{type:Boolean}},emits:["close","selected","cancel"],setup(K,{emit:v}){const b=K,j=v,{selectThumbnail:f,selectTempVideoThumbnail:L}=zt(),{t:r}=Ve(),D=C(0),U=C(""),P=C(b.initialContent||""),S=C(!1),H=W(()=>(U.value===""?0:Number(U.value))>=0&&!S.value),se=W(()=>U.value===""?0:Number(U.value)),Q=y=>{D.value=y},Y=()=>{if(U.value==="")return;const y=Number(U.value);(!Number.isInteger(y)||y<0)&&(U.value=Math.max(0,Math.floor(y)).toString())},ne=async()=>{if(H.value){S.value=!0;try{if(b.isTemp&&b.tempVideoId){const{error:y}=await L(b.conversationId,b.tempVideoId,D.value);if(y){Ut().$toast.error(y.message||r("inbox.failedToSelectThumbnail")),S.value=!1;return}j("selected",{thumbnailIndex:D.value,price:se.value,content:P.value,tempVideoId:b.tempVideoId}),j("close")}else if(b.videoId){const{data:y,error:h}=await f(b.conversationId,b.videoId,D.value,se.value);h?Ut().$toast.error(h.message||r("inbox.failedToSaveVideoSettings")):(Ut().$toast.success(r("inbox.videoUploadedSuccess")),j("selected",{thumbnailIndex:D.value,price:se.value,content:P.value}),j("close"))}}catch{Ut().$toast.error(r("inbox.unexpectedError"))}finally{S.value=!1}}},R=()=>{S.value||(b.isTemp&&j("cancel"),j("close"))};return b.isTemp,b.videoId,b.tempVideoId,b.thumbnailOptions,(y,h)=>(s(),ee(Nn,{onClose:R,onOutsideClick:R},{footer:Oe(()=>[J(In,{onClick:ne,disabled:!H.value,class:"w-full"},{default:Oe(()=>[S.value?(s(),n("span",ro,o(t(r)("inbox.sending")),1)):(s(),n("span",ao,o(t(r)("inbox.sendContent")),1))]),_:1},8,["disabled"])]),default:Oe(()=>[e("div",zn,[e("div",Wn,[e("div",qn,[e("div",null,[e("span",Kn,o(t(r)("inbox.selectThumbnail")),1),e("div",Yn,o(t(r)("inbox.chooseThumbnailPreview")),1)])]),e("div",Qn,[(s(!0),n(ae,null,_e(y.thumbnailOptions,c=>(s(),n("div",{key:c.index,onClick:m=>Q(c.index),class:"relative cursor-pointer"},[e("img",{src:c.small_url||c.url,alt:`Thumbnail ${c.index+1}`,class:O(["w-full h-24 object-cover rounded-lg transition-all",D.value===c.index?"ring-2 ring-x-pink-1":""]),onError:m=>console.error("Thumbnail load error:",c)},null,42,Jn),D.value===c.index?(s(),n("div",Xn,to)):d("",!0)],8,Zn))),128))])]),e("div",so,[e("label",no,o(t(r)("inbox.messageOptional")),1),He(e("input",{"onUpdate:modelValue":h[0]||(h[0]=c=>P.value=c),type:"text",class:"w-full flex-1 h-full text-black p-4 text-xs rounded-2xl border border-x-grey-1 shadow focus-visible:outline-none focus-visible:shadow-light-grey"},null,512),[[Fe,P.value]])]),e("div",oo,[e("label",io,o(t(r)("inbox.price")),1),He(e("input",{"onUpdate:modelValue":h[1]||(h[1]=c=>U.value=c),type:"number",min:"0",step:"1",onInput:Y,class:"w-full flex-1 h-full text-black p-4 text-xs rounded-2xl border border-x-grey-1 shadow focus-visible:outline-none focus-visible:shadow-light-grey"},null,544),[[Fe,U.value]]),e("span",lo,o(t(r)("inbox.setPriceForContent")),1)])])]),_:1}))}}),uo=Fs(co,[["__scopeId","data-v-66590e5b"]]),xo={class:"flex-1 overflow-y-auto"},ho={key:0,class:"absolute inset-0 z-10 flex items-center justify-center bg-white/80 backdrop-blur-sm"},fo={class:"flex flex-col items-center gap-3"},vo=e("div",{class:"w-8 h-8 border-2 border-x-pink-1 border-t-transparent roun
1ded-full animate-spin"},null,-1),po={class:"text-xs text-x-grey-15"},go={key:1,class:"flex flex-col items-center justify-center h-full px-6"},_o=Ne('<div class="bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"><div class="w-12 h-12 flex items-center justify-center text-white"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg></div></div>',1),mo={class:"text-sm text-black font-semibold"},bo={class:"text-xs text-x-grey-15 text-center max-w-60 mt-2"},yo={key:2},wo={class:"flex border-0 sticky top-0 z-10 bg-white px-4",style:{"border-bottom":"1px solid #ff5281"}},ko={key:0,class:"flex flex-col items-center justify-center py-8 px-4"},$o={class:"text-sm text-black font-semibold"},Co={class:"text-xs text-x-grey-15 text-center max-w-60 mt-2"},Mo={key:1,class:"p-4"},So={class:"grid grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2"},To={class:"text-xs col-span-full my-2"},jo=["onClick"],Do=["src","alt","onError"],Uo={key:1,class:"absolute inset-0 bg-gradient-to-br from-pink-400 via-pink-500 to-red-500 flex items-center justify-center"},Eo={key:0,class:"bg-black/30 rounded-full p-3"},Oo=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 24 24",fill:"white",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("polygon",{points:"5 3 19 12 5 21 5 3"})],-1),Bo=[Oo],Vo={key:2,class:"absolute inset-0 flex items-center justify-center pointer-events-none"},Po=e("div",{class:"bg-black/50 rounded-full p-3"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 24 24",fill:"white",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("polygon",{points:"5 3 19 12 5 21 5 3"})])],-1),No={key:0,class:"absolute bottom-2 right-2 bg-black/70 text-white text-[10px] px-1.5 py-0.5 rounded"},Io={key:3,class:"absolute bottom-2 right-2 bg-black/70 text-white text-[10px] px-1.5 py-0.5 rounded"},Lo={key:4,class:"absolute inset-0 bg-black/40 flex flex-col items-center justify-center"},Ro=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"drop-shadow-md"},[e("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})],-1),Ao=["onClick","disabled"],Go={key:0},Ho=e("span",{class:"inline-block w-2 h-2 border-[1.5px] border-t-transparent border-white rounded-full animate-spin mr-1 align-middle"},null,-1),Fo={key:1},zo={key:0,class:"hidden"},Wo=["href","data-fancybox","data-media-id","data-type","data-thumb"],qo={key:1,class:"hidden"},Ko=["href","data-fancybox","data-media-id","data-type","data-thumb"],Yo=Pe({__name:"MediaGallery",props:{conversationId:{}},setup(K){const{t:v}=Ve(),b=K,j=yt(),{media:f,loading:L}=Be(j),r=Bt(),{currentUser:D}=Be(r),U=C("received"),{initFancybox:P,bindFancybox:S}=An(),H=W(()=>`received-gallery-${b.conversationId}`),se=W(()=>`sent-gallery-${b.conversationId}`),Q=C({}),Y=C({}),ne=k=>{Y.value[k]=!0},R=async k=>{var T;if(!k)return;const $=c.value.find(he=>he.message_id===k);if(!$)return;const w=gn(),{unlockMessage:M}=_n(),B=h($)?"video":"image";w.showPurchaseConfirmationModal({imageUrl:$.blurred_url||z($),count:1,creditCost:((T=$.message)==null?void 0:T.price)||1,mediaType:B,onConfirm:async()=>{var me;const he=`unlock-message-${k}`;Q.value[k]=!0,await M(b.conversationId,k,{loadingKey:he,setIsUnlocking:be=>{Q.value[k]=be},onRefresh:()=>{j.fetchMedia(b.conversationId)},modalData:{imageUrl:$.blurred_url||z($),count:1,creditCost:((me=$.message)==null?void 0:me.price)||1,mediaType:B}})}})};xe(()=>b.conversationId,async k=>{k&&await j.fetchMedia(k)},{immediate:!0}),xe(()=>U.value,()=>{ue(()=>{const k=U.value==="received"?H.value:se.value;S(`[data-fancybox="${k}"]`,{infinite:!0,caption:!1,showClass:"fancybox-fadeIn",hideClass:"fancybox-fadeOut",Html:{video:{autoplay:!1,controls:!0,playsinline:!0,tpl:'<video class="fancybox__html5video" playsinline controls controlsList="nodownload"><source src="{{src}}" type="{{format}}" /></video>'}}})})}),xe(()=>f.value[b.conversationId],()=>{ue(()=>{S(`[data-fancybox="${H.value}"]`,{infinite:!0,caption:!1,showClass:"fancybox-fadeIn",hideClass:"fancybox-fadeOut",Html:{video:{autoplay:!1,controls:!0,playsinline:!0,tpl:'<video class="fancybox__html5video" playsinline controls controlsList="nodownload"><source src="{{src}}" type="{{format}}" /></video>'}}}),S(`[data-fancybox="${se.value}"]`,{infinite:!0,caption:!1,showClass:"fancybox-fadeIn",hideClass:"fancybox-fadeOut",Html:{video:{autoplay:!1,controls:!0,playsinline:!0,tpl:'<video class="fancybox__html5video" playsinline controls controlsList="nodownload"><source src="{{src}}" type="{{format}}" /></video>'}}})})},{deep:!0});const y=k=>{if(k.is_locked)return;const $=U.value==="sent"?se.value:H.value,w=`[data-fancybox="${$}"][data-media-id="${k.id}"]`,M=document.querySelector(w);if(M)M.click();else{const B=document.querySelector(`[data-fancybox="${$}"]`);B&&B.click()}};ze(async()=>{await P(),ue(()=>{S(`[data-fancybox="${H.value}"]`,{infinite:!0,caption:!1,showClass:"fancybox-fadeIn",hideClass:"fancybox-fadeOut",Html:{video:{autoplay:!1,controls:!0,playsinline:!0,tpl:'<video class="fancybox__html5video" playsinline controls controlsList="nodownload"><source src="{{src}}" type="{{format}}" /></video>'}}}),S(`[data-fancybox="${se.value}"]`,{infinite:!0,caption:!1,showClass:"fancybox-fadeIn",hideClass:"fancybox-fadeOut",Html:{video:{autoplay:!1,controls:!0,playsinline:!0,tpl:'<video class="fancybox__html5video" playsinline controls controlsList="nodownload"><source src="{{src}}" type="{{format}}" /></video>'}}})})});const h=k=>k.media_type==="video"||"video_url"in k,c=W(()=>f.value[b.conversationId]||[]),m=W(()=>{if(!D.value)return[];const k=D.value.id;return c.value.filter($=>{var w;if($.user_id!==void 0)return $.user_id===k;if($.message_id){const M=(w=j.messages[b.conversationId])==null?void 0:w.find(B=>B.id===$.message_id);if(M)return M.user.id===k}return!0})}),N=W(()=>{if(!D.value)return[];const k=D.value.id;return c.value.filter($=>{var w;if($.user_id!==void 0)return $.user_id!==k;if($.message_id){const M=(w=j.messages[b.conversationId])==null?void 0:w.find(B=>B.id===$.message_id);if(M)return M.user.id!==k}return!1})}),F=W(()=>{const k=U.value==="sent"?m.value:N.value;if(!k.length)return[];const $={},w=new Date,M=new Date(w);M.setDate(w.getDate()-w.getDay());const B=new Date(M);
1return B.setDate(B.getDate()-7),k.forEach(oe=>{let T=v("inbox.earlier");const he=oe.message_id?new Date(oe.created_at||new Date):new Date;he>=M?T=v("inbox.recent"):he>=B&&(T=v("inbox.lastWeek")),$[T]||($[T]=[]),$[T].push(oe)}),Object.entries($).filter(([oe,T])=>T.length>0).map(([oe,T])=>({name:oe,items:T}))}),z=k=>{if(k.is_locked&&k.blurred_url)return k.blurred_url;if(h(k))return k.thumbnail_url||"";const $=k;return $.small_thumbnail_url?$.small_thumbnail_url:$.thumbnail_url?$.thumbnail_url:$.url?$.url:Vs($,"thumbnail",b.conversationId)},G=k=>{if(k.is_locked)return k.blurred_url||z(k);if(h(k))return k.video_url;const $=k;return $.url?$.url:Vs($,"original",b.conversationId)};return(k,$)=>(s(),n("div",xo,[t(L).media?(s(),n("div",ho,[e("div",fo,[vo,e("p",po,o(t(v)("inbox.loadingMedia")),1)])])):c.value.length?(s(),n("div",yo,[e("div",wo,[e("button",{onClick:$[0]||($[0]=w=>U.value="received"),class:O(["px-4 py-2.5 text-sm font-medium relative focus:outline-none",U.value==="received"?"text-x-pink-1 font-semibold":"text-gray-500"])},o(t(v)("inbox.receivedMedia"))+" ("+o(N.value.length)+") ",3),e("button",{onClick:$[1]||($[1]=w=>U.value="sent"),class:O(["px-4 py-2.5 text-sm font-medium relative focus:outline-none",U.value==="sent"?"text-x-pink-1 font-semibold":"text-gray-500"])},o(t(v)("inbox.sentMedia"))+" ("+o(m.value.length)+") ",3)]),U.value==="sent"&&!m.value.length||U.value==="received"&&!N.value.length?(s(),n("div",ko,[e("span",$o,o(U.value==="sent"?t(v)("inbox.noSentMedia"):t(v)("inbox.noReceivedMedia")),1),e("span",Co,o(U.value==="sent"?t(v)("inbox.mediaYouShareHere"):t(v)("inbox.mediaSharedWithYouHere")),1)])):(s(),n("div",Mo,[e("div",So,[(s(!0),n(ae,null,_e(F.value,w=>(s(),n(ae,{key:w.name},[e("span",To,o(w.name),1),(s(!0),n(ae,null,_e(w.items,(M,B)=>{var oe;return s(),n("div",{key:M.id,class:"aspect-square rounded-2xl overflow-hidden relative cursor-pointer",onClick:T=>!M.is_locked&&y(M)},[z(M)&&!Y.value[M.id]?(s(),n("img",{key:0,class:"w-full h-full object-cover",src:z(M),alt:M.original_filename||t(v)("inbox.media"),onError:T=>ne(M.id)},null,40,Do)):(s(),n("div",Uo,[h(M)?(s(),n("div",Eo,Bo)):d("",!0)])),h(M)&&!M.is_locked&&z(M)&&!Y.value[M.id]?(s(),n("div",Vo,[Po,M.formatted_duration?(s(),n("div",No,o(M.formatted_duration),1)):d("",!0)])):d("",!0),h(M)&&!M.is_locked&&(!z(M)||Y.value[M.id])&&M.formatted_duration?(s(),n("div",Io,o(M.formatted_duration),1)):d("",!0),M.is_locked?(s(),n("div",Lo,[Ro,e("button",{class:"mt-2 bg-x-pink-1 text-white text-[10px] py-0.5 px-2 rounded-full shadow-md hover:bg-x-pink-1/90 transition-colors mx-2",onClick:pn(T=>R(M.message_id||0),["stop"]),disabled:Q.value[M.message_id||0]},[Q.value[M.message_id||0]?(s(),n("span",Go,[Ho,ie(" "+o(t(v)("inbox.unlocking")),1)])):(s(),n("span",Fo,o(t(v)("inbox.unlockForCredits",{price:((oe=M.message)==null?void 0:oe.price)||1})),1))],8,Ao)])):d("",!0)],8,jo)}),128))],64))),128))]),U.value==="sent"?(s(),n("div",zo,[(s(!0),n(ae,null,_e(m.value.filter(w=>!w.is_locked),(w,M)=>(s(),n("a",{key:`sent-link-${w.id}`,href:G(w),"data-fancybox":se.value,"data-media-id":w.id,"data-type":h(w)?"html5video":"image","data-thumb":h(w)?w.thumbnail_url:void 0},null,8,Wo))),128))])):d("",!0),U.value==="received"?(s(),n("div",qo,[(s(!0),n(ae,null,_e(N.value.filter(w=>!w.is_locked),(w,M)=>(s(),n("a",{key:`received-link-${w.id}`,href:G(w),"data-fancybox":H.value,"data-media-id":w.id,"data-type":h(w)?"html5video":"image","data-thumb":h(w)?w.thumbnail_url:void 0},null,8,Ko))),128))])):d("",!0)]))])):(s(),n("div",go,[_o,e("span",mo,o(t(v)("inbox.noMedia")),1),e("span",bo,o(t(v)("inbox.mediaSharedHere")),1)]))]))}}),Qo={class:"flex flex-col h-full relative"},Zo={key:0,class:"flex items-center justify-between px-4 py-2 bg-white border-b border-x-grey-1"},Jo={class:"text-xs text-x-grey-15"},Xo={class:"flex items-center gap-1"},ei={key:1,class:"flex-1 flex items-center justify-center"},ti={class:"flex flex-col items-center gap-3"},si=e("div",{class:"w-8 h-8 border-2 border-x-pink-1 border-t-transparent rounded-full animate-spin"},null,-1),ni={class:"text-xs text-x-grey-15"},oi={key:2,class:"flex-1 flex items-center justify-center"},ii={class:"flex flex-col items-center gap-3"},li={class:"text-xs text-red-500"},ri={key:3,class:"flex-1 flex flex-col items-center justify-center p-8"},ai=Ne('<div class="bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"><div class="w-12 h-12 flex items-center justify-center text-white"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg></div></div>',1),ci={class:"text-sm text-black font-semibold"},di={key:4,class:"flex-1 flex flex-col items-center justify-center p-8"}
1,ui=Ne('<div class="bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"><div class="w-12 h-12 flex items-center justify-center text-white"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg></div></div>',1),xi={class:"text-sm text-black font-semibold"},hi={class:"text-xs text-x-grey-15 text-center mt-2"},fi={key:5,class:"absolute inset-0 z-10 flex items-center justify-center bg-white/80 backdrop-blur-sm"},vi={class:"flex flex-col items-center gap-3"},pi=e("div",{class:"w-8 h-8 border-2 border-x-pink-1 border-t-transparent rounded-full animate-spin"},null,-1),gi={class:"text-xs text-x-grey-15"},_i={key:6,class:"flex-1 overflow-y-auto bg-white"},mi=["onClick"],bi={class:"relative"},yi={class:"w-10 h-10 rounded-full shrink-0 overflow-hidden"},wi=["src","alt"],ki={key:1,class:"flex items-center justify-center w-full h-full bg-x-pink-1/10 text-x-pink-2"},$i={class:"uppercase text-sm"},Ci={key:0,class:"absolute bottom-0 right-0 w-3 h-3 bg-x-green-1 border-2 border-white rounded-full"},Mi={class:"flex flex-col gap-2 flex-1 min-w-0"},Si={class:"flex items-center justify-between gap-2"},Ti={class:"flex items-center gap-2 min-w-0 overflow-hidden"},ji={class:"text-sm text-black leading-none truncate"},Di={class:"text-xs text-x-grey-15 leading-none flex-shrink-0 ml-2"},Ui={class:"flex items-center gap-2"},Ei={class:"text-xs text-x-grey-15 truncate"},Oi={key:0},Bi=e("div",{class:"flex-shrink-0"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"text-x-grey-15"},[e("polyline",{points:"9 18 15 12 9 6"})])],-1),Qs=Pe({__name:"ProfileViewsList",setup(K){const{t:v}=Ve(),b=Vt(),j=yt(),{getProfileViews:f}=Ws(),L=C([]),r=C(!0),D=C(null),U=C(!1),P=C(!1),S=W(()=>{let h=[...L.value];return P.value&&(h=h.filter(c=>{var m;return b.isUserOnline((m=c.user)==null?void 0:m.id)})),h.sort((c,m)=>{var z,G;const N=b.isUserOnline((z=c.user)==null?void 0:z.id),F=b.isUserOnline((G=m.user)==null?void 0:G.id);return N&&!F?-1:!N&&F?1:new Date(m.last_viewed_at).getTime()-new Date(c.last_viewed_at).getTime()})}),H=W(()=>L.value.filter(h=>{var c;return b.isUserOnline((c=h.user)==null?void 0:c.id)}).length);function se(h){return b.isUserOnline(h)}async function Q(h){var c;if(!(!((c=h.user)!=null&&c.id)||U.value)){U.value=!0;try{j.conversations.length===0&&await j.fetchConversations();const m=j.conversations.find(N=>{var F,z;return((F=N.initiator_user)==null?void 0:F.id)===h.user.id||((z=N.recipient_user)==null?void 0:z.id)===h.user.id});m?qt(`/users/account/messages/${m.id}`):window.location.href=`${Is(Ls.USERS_ACCOUNT_MESSAGES,!0)}?uid=${h.user.id}`}catch(m){console.error("Error starting conversation with viewer:",m)}finally{U.value=!1}}}async function Y(){r.value=!0,D.value=null;try{const{data:h,error:c}=await f();if(c||!h){D.value=c||"Failed to load profile views";return}L.value=h,y()}catch(h){console.error("Error fetching profile views:",h),D.value="Failed to load profile views"}finally{r.value=!1}}function ne(h){const c=new Date(h),N=new Date().getTime()-c.getTime(),F=Math.floor(N/(1e3*60*60*24));return F===0?v("online.today"):F===1?v("online.yesterday"):F<7?`${F} ${v("online.daysAgo")}`:c.toLocaleDateString()}let R=[];function y(){R.length>0&&b.unwatchUsers(R),R=L.value.map(h=>{var c;return(c=h.user)==null?void 0:c.id}).filter(h=>!!h),R.length>0&&b.watchUsers(R)}return ze(()=>{Y()}),Yt(()=>{R.length>0&&b.unwatchUsers(R)}),(h,c)=>(s(),n("div",Qo,[!r.value&&!D.value&&L.value.length>0?(s(),n("div",Zo,[e("span",Jo,o(S.value.length)+" "+o(P.value?t(v)("account.onlineViewers"):t(v)("account.viewers")),1),e("div",Xo,[e("button",{onClick:c[0]||(c[0]=m=>P.value=!1),class:O(["text-xs px-3 py-1 rounded-full transition-colors",P.value?"bg-x-grey-2 text-x-grey-15 hover:bg-x-grey-4":"bg-x-pink-1 text-white"])},o(t(v)("account.showAll"))+" ("+o(L.value.length)+") ",3),e("button",{onClick:c[1]||(c[1]=m=>P.value=!0),class:O(["text-xs px-3 py-1 rounded-full transition-colors",P.value?"bg-x-green-4 text-x-green-5":"bg-x-grey-2 text-x-grey-15 hover:bg-x-grey-4"])},o(t(v)("account.onlineOnly"))+" ("+o(H.value)+") ",3)])])):d("",!0),r.value?(s(),n("div",ei,[e("div",ti,[si,e("p",ni,o(t(v)("account.profileViews"))+"...",1)])])):D.value?(s(),n("div",oi,[e("div",ii,[e("p",li,o(D.value),1),e("button",{onClick:Y,class:"text-xs text-x-pink-1 underline"}
1,o(t(v)("tryAgain")),1)])])):L.value.length===0?(s(),n("div",ri,[ai,e("span",ci,o(t(v)("account.profileViewsEmptyPlaceholder")),1)])):S.value.length===0&&P.value?(s(),n("div",di,[ui,e("span",xi,o(t(v)("account.noOnlineViewers")),1),e("span",hi,o(t(v)("account.noOnlineViewersDescription")),1),e("button",{onClick:c[2]||(c[2]=m=>P.value=!1),class:"mt-4 text-xs px-4 py-2 rounded-full bg-x-pink-1 text-white"},o(t(v)("account.showAll")),1)])):d("",!0),U.value?(s(),n("div",fi,[e("div",vi,[pi,e("p",gi,o(t(v)("account.openingConversation"))+"...",1)])])):(s(),n("div",_i,[(s(!0),n(ae,null,_e(S.value,m=>{var N,F,z,G,k,$,w,M;return s(),n("button",{key:(N=m.user)==null?void 0:N.id,onClick:B=>Q(m),class:"w-full flex items-center p-4 gap-4 border-b border-x-grey-23 even:bg-x-grey-2 hover:bg-x-grey-4 transition-colors cursor-pointer text-left"},[e("div",bi,[e("div",yi,[(F=m.user)!=null&&F.photo_url?(s(),n("img",{key:0,src:m.user.photo_url,alt:m.user.display_name||m.user.username,class:"w-full h-full object-cover"},null,8,wi)):(s(),n("span",ki,[e("span",$i,o((((z=m.user)==null?void 0:z.display_name)||((G=m.user)==null?void 0:G.username)||"?").substring(0,1)),1)]))]),se((k=m.user)==null?void 0:k.id)?(s(),n("span",Ci)):d("",!0)]),e("div",Mi,[e("div",Si,[e("div",Ti,[e("span",ji,o((($=m.user)==null?void 0:$.display_name)||((w=m.user)==null?void 0:w.username)),1)]),e("span",Di,o(ne(m.last_viewed_at)),1)]),e("div",Ui,[e("p",Ei,[(M=m.user)!=null&&M.location?(s(),n("span",Oi,o(m.user.location)+" · ",1)):d("",!0),ie(" "+o(m.total_views)+" "+o(m.total_views===1?t(v)("account.view"):t(v)("account.views")),1)])])]),Bi],8,mi)}),128))]))]))}}),Vi={class:"flex flex-col h-full relative"},Pi={key:0,class:"flex items-center justify-between px-4 py-2 bg-white border-b border-x-grey-1"},Ni={class:"text-xs text-x-grey-15"},Ii={class:"flex items-center gap-1"},Li={key:1,class:"flex-1 flex items-center justify-center"},Ri={class:"flex flex-col items-center gap-3"},Ai=e("div",{class:"w-8 h-8 border-2 border-x-pink-1 border-t-transparent rounded-full animate-spin"},null,-1),Gi={class:"text-xs text-x-grey-15"},Hi={key:2,class:"flex-1 flex items-center justify-center"},Fi={class:"flex flex-col items-center gap-3"},zi={class:"text-xs text-red-500"},Wi={key:3,class:"flex-1 flex flex-col items-center justify-center p-8"},qi=Ne('<div class="bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"><div class="w-12 h-12 flex items-center justify-center text-white"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg></div></div>',1),Ki={class:"text-sm text-black font-semibold"},Yi={class:"text-xs text-x-grey-15 text-center mt-2"},Qi={key:4,class:"flex-1 flex flex-col items-center justify-center p-8"},Zi=Ne('<div class="bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"><div class="w-12 h-12 flex items-center justify-center text-white"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg></div></div>',1),Ji={class:"text-sm text-black font-semibold"},Xi={class:"text-xs text-x-grey-15 text-center mt-2"},el={key:5,class:"absolute inset-0 z-10 flex items-center justify-center bg-white/80 backdrop-blur-sm"},tl={class:"flex flex-col items-center gap-3"},sl=e("div",{class:"w-8 h-8 border-2 border-x-pink-1 border-t-transparent rounded-full animate-spin"},null,-1),nl={class:"text-xs text-x-grey-15"},ol={key:6,class:"flex-1 overflow-y-auto bg-white"},il=["onClick"],ll={class:"relative"},rl={class:"w-10 h-10 rounded-full shrink-0 overflow-hidden"},al=["src","alt"],cl={key:1,class:"flex items-center justify-center w-full h-full bg-x-pink-1/10 text-x-pink-2"},dl={class:"uppercase text-sm"},ul={key:0,class:"absolute bottom-0 right-0 w-3 h-3 bg-x-green-1 border-2 border-white rounded-full"},xl={class:"flex flex-col gap-2 flex-1 min-w-0"},hl={class:"flex items-center justify-between gap-2"},fl={class:"flex items-center gap-2 min-w-0 overflow-hidden"},vl={class:"text-sm text-black leading-none truncate"},pl={key:0,class:"badge badge-sm text-xxs gap-1 bg-x-grey-2 text-x-grey-15 flex-shrink-0"},gl={class:"text-xs text-x-grey-15 leading-none flex-shrink-0 ml-2"},_l={class:"flex items-center gap-2"},ml={class:"text-xs text-x-grey-15 truncate"},bl=e("div",{class:"flex-shrink-0"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"text-x-grey-15"},[e("polyline",{points:"9 18 15 12 9 6"})])],-1),Zs=Pe({__name:"PurchasedGalleriesList",setup(K){const{t:v}=Ve(),b=Vt(),j=yt(),{getGallerySubscribers:f}=Ws(),L=C([]),r=C(!0),D=C(null),U=C(!1),P=C(!1),S=W(()=>{let y=[...L.value];return P.value&&(y=y.filter(h=>{var c;return b.isUserOnline((c=h.user)==null?void 0:c.id)})),y.sort((h,c)=>{var F,z;const m=b.isUserOnline((F=h.user)==null?void 0:F.id),N=b.isUserOnline((z=c.user)==null?void 0:z.id);return m&&!N?-1:!m&&N?1:new Date(c.subscribed_at).getTime()-new Date(h.subscribed_at).getTime()})}),H=W(()=>L.value.filter(y=>{var h;return b.isUserOnline((h=y.user)==null?void 0:h.id)}).length);function se(y){return b.isUserOnline(y)}async function Q(y){var h;if(!(!((h=y.user)!=null&&h.id)||U.value)){U.value=!0;try{j.conversations.length===0&&await j.fetchConversations();const c=j.conversations.find(m=>{var N,F;return((N=m.initiator_user)==null?void 0:N.id)===y.user.id||((F=m.recipient_user)==null?void 0:F.id)===y.user.id});c?qt(`/users/account/messages/${c.id}`):window.location.href=`${Is(Ls.USERS_ACCOUNT_MESSAGES,!0)}?uid=${y.user.id}`}catch(c){console.error("Error starting conversation with subscriber:",c)}finally{U.value=!1}}}async function Y(){r.value=!0,D.value=null;try{const{data:y,error:h}=await f();if(h||!y){D.value=h||"Failed to load gallery subscribers";return}L.value=y,R()}catch(y){console.error("Error fetching gallery subscribers:",y),D.value="Failed to load gallery subscribers"}finally{r.value=!1}}let ne=[];function R(){ne.length>0&&b.unwatchUsers(ne),ne=L.value.map(y=>{var h;
1return(h=y.user)==null?void 0:h.id}).filter(y=>!!y),ne.length>0&&b.watchUsers(ne)}return ze(()=>{Y()}),Yt(()=>{ne.length>0&&b.unwatchUsers(ne)}),(y,h)=>(s(),n("div",Vi,[!r.value&&!D.value&&L.value.length>0?(s(),n("div",Pi,[e("span",Ni,o(S.value.length)+" "+o(P.value?t(v)("account.onlineSubscribers"):t(v)("account.subscribers")),1),e("div",Ii,[e("button",{onClick:h[0]||(h[0]=c=>P.value=!1),class:O(["text-xs px-3 py-1 rounded-full transition-colors",P.value?"bg-x-grey-2 text-x-grey-15 hover:bg-x-grey-4":"bg-x-pink-1 text-white"])},o(t(v)("account.showAll"))+" ("+o(L.value.length)+") ",3),e("button",{onClick:h[1]||(h[1]=c=>P.value=!0),class:O(["text-xs px-3 py-1 rounded-full transition-colors",P.value?"bg-x-green-4 text-x-green-5":"bg-x-grey-2 text-x-grey-15 hover:bg-x-grey-4"])},o(t(v)("account.onlineOnly"))+" ("+o(H.value)+") ",3)])])):d("",!0),r.value?(s(),n("div",Li,[e("div",Ri,[Ai,e("p",Gi,o(t(v)("loading"))+"...",1)])])):D.value?(s(),n("div",Hi,[e("div",Fi,[e("p",zi,o(D.value),1),e("button",{onClick:h[2]||(h[2]=(...c)=>y.fetchGalleryBuyers&&y.fetchGalleryBuyers(...c)),class:"text-xs text-x-pink-1 underline"},o(t(v)("tryAgain")),1)])])):L.value.length===0?(s(),n("div",Wi,[qi,e("span",Ki,o(t(v)("account.noGallerySubscribers")),1),e("span",Yi,o(t(v)("account.noGallerySubscribersDescription")),1)])):S.value.length===0&&P.value?(s(),n("div",Qi,[Zi,e("span",Ji,o(t(v)("account.noOnlineSubscribers")),1),e("span",Xi,o(t(v)("account.noOnlineSubscribersDescription")),1),e("button",{onClick:h[3]||(h[3]=c=>P.value=!1),class:"mt-4 text-xs px-4 py-2 rounded-full bg-x-pink-1 text-white"},o(t(v)("account.showAll")),1)])):d("",!0),U.value?(s(),n("div",el,[e("div",tl,[sl,e("p",nl,o(t(v)("account.openingConversation"))+"...",1)])])):(s(),n("div",ol,[(s(!0),n(ae,null,_e(S.value,c=>{var m,N,F,z,G,k,$;return s(),n("button",{key:(m=c.user)==null?void 0:m.id,onClick:w=>Q(c),class:"w-full flex items-center p-4 gap-4 border-b border-x-grey-23 even:bg-x-grey-2 hover:bg-x-grey-4 transition-colors cursor-pointer text-left"},[e("div",ll,[e("div",rl,[(N=c.user)!=null&&N.photo_url?(s(),n("img",{key:0,src:c.user.photo_url,alt:c.user.display_name||c.user.username,class:"w-full h-full object-cover"},null,8,al)):(s(),n("span",cl,[e("span",dl,o((((F=c.user)==null?void 0:F.display_name)||((z=c.user)==null?void 0:z.username)||"?").substring(0,1)),1)]))]),se((G=c.user)==null?void 0:G.id)?(s(),n("span",ul)):d("",!0)]),e("div",xl,[e
1("div",hl,[e("div",fl,[e("span",vl,o(((k=c.user)==null?void 0:k.display_name)||(($=c.user)==null?void 0:$.username)),1),c.is_active?d("",!0):(s(),n("span",pl,o(t(v)("account.expired")),1))]),e("span",gl,o(new Date(c.subscribed_at).toLocaleDateString()),1)]),e("div",_l,[e("p",ml,o(t(v)("account.subscribedGalleriesCount",{count:c.galleries_count})),1)])]),bl],8,il)}),128))]))]))}}),yl=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",class:"text-x-grey-15"},[e("circle",{cx:"12",cy:"5",r:"2"}),e("circle",{cx:"12",cy:"12",r:"2"}),e("circle",{cx:"12",cy:"19",r:"2"})],-1),wl=[yl],kl={key:0,class:"absolute left-full top-0 ml-1 w-36 bg-white rounded-xl shadow-lg border border-x-grey-1 py-1 z-50"},$l=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M3 6h18"}),e("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})],-1),Gt=Pe({__name:"MessageActionMenu",emits:["delete"],setup(K,{emit:v}){const b=v,{t:j}=Ve(),f=C(!1),L=C(null);function r(S){S.stopPropagation(),f.value=!f.value}function D(){f.value=!1}function U(){D(),b("delete")}function P(S){L.value&&!L.value.contains(S.target)&&D()}return ze(()=>{document.addEventListener("click",P)}),Yt(()=>{document.removeEventListener("click",P)}),(S,H)=>(s(),n("div",{ref_key:"menuRef",ref:L,class:"relative"},[e("button",{onClick:r,class:O(["w-7 h-7 flex items-center justify-center rounded-full bg-white shadow-md border border-gray-200 hover:bg-gray-50 transition-colors",f.value?"bg-gray-100":""])},wl,2),J(mn,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:Oe(()=>[f.value?(s(),n("div",kl,[e("button",{onClick:U,class:"w-full px-3 py-2 text-left text-sm text-red-500 hover:bg-red-50 flex items-center gap-2 transition-colors"},[$l,ie(" "+o(t(j)("inbox.delete")),1)])])):d("",!0)]),_:1})],512))}}),te=K=>(Ps("data-v-a82637ae"),K=K(),Ns(),K),Cl={class:"flex flex-col flex-1"},Ml={key:0,class:"absolute inset-0 z-10 flex flex-col items-center justify-center bg-white/80 backdrop-blur-sm"},Sl=te(()=>e("div",{class:"w-8 h-8 border-2 border-t-transparent border-x-pink-1 rounded-full animate-spin"},null,-1)),Tl={class:"mt-4 text-sm text-x-grey-15"},jl={key:1,class:"flex flex-col flex-1"},Dl={class:"flex items-center gap-4 px-6 mb-6 py-4 border-b border-x-grey-1"},Ul={key:0,class:"flex items-center gap-0 h-full relative"},El={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},Ol={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},Bl={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},Vl={key:1,class:"flex items-center gap-0 h-full relative"},Pl={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},Nl={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},Il={key:2,class:"flex items-center gap-0 ml-auto h-full relative"},Ll={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},Rl={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},Al={key:0,class:"container-md flex flex-col flex-1"},Gl={class:"border border-x-grey-1 rounded-2xl overflow-y-auto overflow-x-hidden shadow max-h-[calc(100vh-240px)] bg-white p-4"},Hl=te(()=>e("p",{class:"text-xs text-x-grey-15 mb-3"},"People you have blocked cannot send you messages. You can unblock them at any time.",-1)),Fl={key:1,class:"container-md flex flex-col flex-1"},zl={class:"flex items-stretch border border-x-grey-1 rounded-2xl overflow-hidden shadow h-[calc(100vh-240px)] bg-white"},Wl={key:2,class:"container-md flex flex-col flex-1"},ql={class:"flex items-stretch border border-x-grey-1 rounded-2xl overflow-hidden shadow h-[calc(100vh-240p
1x)] bg-white"},Kl={key:0,class:"relative bg-[#8BC34A] text-white text-xs px-6 py-2.5 flex items-center justify-center"},Yl={class:"text-center"},Ql=te(()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)),Zl=[Ql],Jl={key:1,class:"absolute inset-0 z-10 flex items-center justify-center bg-white/80 backdrop-blur-sm"},Xl={class:"flex flex-col items-center gap-3"},er=te(()=>e("div",{class:"w-8 h-8 border-2 border-x-pink-1 border-t-transparent rounded-full animate-spin"},null,-1)),tr={class:"text-xs text-x-grey-15"},sr={key:2,class:"container-md"},nr={class:"flex flex-col items-center p-4 bg-white rounded-2xl shadow"},or=te(()=>e("div",{class:"bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"},[e("div",{class:"w-12 h-12 flex items-center justify-center text-white"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M2.2 16.06L3.88 12 2.2 7.94l4.06-1.68L7.94 2.2 12 3.88l4.06-1.68 1.68 4.06 4.06 1.68L20.12 12l1.68 4.06-4.06 1.68-1.68 4.06L12 20.12 7.94 21.8l-1.68-4.06-4.06-1.68z"})])])],-1)),ir={class:"text-sm text-black font-semibold"},lr={class:"text-xs text-x-grey-15"},rr={key:3,class:"container-md flex flex-col"},ar={class:"flex items-stretch border border-x-grey-1 rounded-2xl overflow-hidden shadow h-[calc(100vh-240px)]"},cr={class:"bg-white w-2/5 min-w-[400px] max-w-[600px] border-r border-x-grey-1 flex flex-col flex-shrink-0"},dr={class:"px-4 py-2 bg-white border-b border-x-grey-1 flex-shrink-0"},ur={class:"flex items-center justify-between px-4 py-2 bg-white border-b border-x-grey-1 flex-shrink-0"},xr={class:"text-xs text-x-grey-15"},hr={class:"flex items-center gap-1"},fr={key:0,class:"flex-1 flex flex-col items-center justify-center p-8"},vr=Ne('<div class="bg-gradient-vertical-light-pink p-4 rounded-xl mb-4" data-v-a82637ae><div class="w-12 h-12 flex items-center justify-center text-white" data-v-a82637ae><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-a82637ae><circle cx="12" cy="12" r="10" data-v-a82637ae></circle><line x1="12" y1="8" x2="12" y2="12" data-v-a82637ae></line><line x1="12" y1="16" x2="12.01" y2="16" data-v-a82637ae></line></svg></div></div>',1),pr={class:"text-sm text-black font-semibold"},gr={class:"text-xs text-x-grey-15 text-center mt-2"},_r={key:1,class:"overflow-y-auto overflow-x-hidden flex-1"},mr=["onClick"],br={class:"relative"},yr=["onClick"],wr=["src","alt"],kr={key:0,class:"text-lg font-bold"},$r={key:1,class:"uppercase text-sm"},Cr={key:0,class:"absolute bottom-0 right-0 w-3 h-3 bg-x-green-1 border-2 border-white rounded-full"},Mr=["title"],Sr=te(()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"text-white"},[e("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})],-1)),Tr=[Sr],jr={class:"flex flex-col gap-2 flex-1 min-w-0"},Dr={class:"flex items-center justify-between gap-2"},Ur={class:"flex items-center gap-2 min-w-0 overflow-hidden"},Er={class:"text-sm text-black leading-none truncate"},Or={key:0,class:"badge-green text-xxs px-2 py-0.5 rounded-full flex-shrink-0"},Br={key:1,class:"badge-gold text-xxs px-2 py-0.5 rounded-full flex-shrink-0"},Vr={key:0,class:"text-xs text-x-grey-15 leading-none flex-shrink-0 ml-2"},Pr={class:"flex items-center gap-2"},Nr={class:"text-xs text-x-grey-15 truncate"},Ir={key:0,class:"flex items-center justify-center ml-auto bg-x-pink-1 text-white text-xxs rounded-full min-w-[18px] h-[18px] px-1 flex-shrink-0"},Lr={key:0,class:"flex justify-center py-3"},Rr=["disabled"],Ar={key:0,class:"animate-spin rounded-full h-3 w-3 border-b border-x-pink-1"},Gr={class:"flex-1 flex flex-col bg-x-grey-2 overflow-hidden"},Hr={key:0,class:"flex flex-col h-full"},Fr={class:"flex-1 flex flex-col items-center justify-center p-8"},zr=te(()=>e("div",{class:"bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"},[e("div",{class:"w-12 h-12 flex items-center justify-center text-white"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})])])],-1)),Wr={class:"text-sm text-black font-semibold"},qr={class:"text-xs text-x-grey-15 text-center max-w-60 mt-2"},Kr={class:"message-input-container flex-shrink-0 bg-white z-20 p-4 border-t border-x-grey-1"},Yr={class:"flex items-center gap-1"},Qr=["placeholder","disabled"],Zr={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent roun
1ded-full animate-spin"},Jr={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Xr=te(()=>e("line",{x1:"22",y1:"2",x2:"11",y2:"13"},null,-1)),ea=te(()=>e("polygon",{points:"22 2 15 22 11 13 2 9 22 2"},null,-1)),ta=[Xr,ea],sa={key:1,class:"flex-1 flex flex-col items-center justify-center p-8"},na=te(()=>e("div",{class:"bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"},[e("div",{class:"w-12 h-12 flex items-center justify-center text-white"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})])])],-1)),oa={class:"text-sm text-black font-semibold"},ia={class:"text-xs text-x-grey-15 text-center max-w-60 mt-2"},la={key:2,class:"flex flex-col h-full overflow-hidden"},ra={class:"flex items-center justify-between px-4 py-3 bg-white border-b border-x-grey-1 flex-shrink-0"},aa={class:"flex items-center gap-3"},ca={class:"relative"},da=["src","alt"],ua={key:0,class:"text-lg font-bold"},xa={key:1,class:"uppercase text-sm"},ha={key:0,class:"absolute bottom-0 right-0 w-3 h-3 bg-x-green-1 border-2 border-white rounded-full"},fa=["title"],va=te(()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"text-white"},[e("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})],-1)),pa=[va],ga={class:"flex flex-col"},_a={class:"text-sm font-semibold text-x-grey-20"},ma={key:0,class:"text-xs text-x-green-1"},ba={key:1,class:"text-xs text-x-green-1"},ya={key:2,class:"text-xs text-x-grey-15"},wa={key:1,class:"flex flex-col h-full overflow-hidden"},ka={key:0,class:"flex items-center justify-center h-full"},$a={class:"flex flex-col items-center gap-3"},Ca=te(()=>e("div",{class:"w-8 h-8 border-2 border-x-pink-1 border-t-transparent rounded-full animate-spin"},null,-1)),Ma={class:"text-xs text-x-grey-15"},Sa={key:1,class:"flex flex-col items-center justify-end h-full py-8"},Ta=te(()=>e("div",{class:"bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"},[e("div",{class:"w-12 h-12 flex items-center justify-center text-white"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})])])],-1)),ja={class:"text-sm text-black font-semibold"},Da={class:"text-xs text-x-grey-15 text-center max-w-60 mt-2"},Ua={key:2,class:"flex flex-col min-h-full justify-end"},Ea={key:0,class:"flex justify-center py-4"},Oa={class:"flex items-center gap-2 bg-white px-4 py-2 rounded-full shadow-md border border-x-grey-1"},Ba=te(()=>e("div",{class:"w-4 h-4 border-2 border-x-pink-1 border-t-transparent rounded-full animate-spin"},null,-1)),Va={class:"text-xs text-x-grey-15"},Pa={class:"grid grid-cols-1 gap-4"},Na={class:"flex items-center justify-center my-4 relative"},Ia={class:"bg-x-grey-2 text-xs text-x-grey-15 px-4 py-1 rounded-full z-10"},La=te(()=>e("div",{class:"absolute h-px w-full bg-x-grey-1"},null,-1)),Ra=["src"],Aa=te(()=>e("div",{class:"w-3 h-3 border border-current border-t-transparent rounded-full animate-spin"},null,-1)),Ga={key:1,class:"group/message flex items-start gap-2 justify-center"},Ha={class:"w-full max-w-[420px] flex flex-col gap-2 relative"},Fa={key:2,class:"group/message flex items-start gap-2 justify-center"},za={class:"w-full max-w-[420px] flex flex-col gap-2 relative"},Wa=["onMouseenter"],qa={key:0,class:"flex-shrink-0 self-center opacity-0 group-hover/message:opacity-100 transition-opacity order-first"},Ka={key:0,class:"flex flex-col"},Ya={class:"self-end mt-1"},Qa={key:1,class:"flex items-end justify-between"},Za=["innerHTML"],Ja={key:1,class:"pr-1.5 break-words"},Xa=["onMouseenter"],ec={key:0,class:"flex-shrink-0 self-center opacity-0 group-hover/message:opacity-100 transition-opacity order-first"},tc={class:"max-w-[80%] flex flex-col gap-2 relative"},sc=["onMouseenter"],nc={key:0,class:"flex-shrink-0 self-center opacity-0 group-hover/message:opacity-100 transition-opacity order-first"},oc={class:"max-w-[80%] flex flex-col gap-2 relative"},ic={key:0,class:"message-input-container relative flex-shrink-0 bg-white z-20 p-4 border-t border-x-grey-1"},lc={key:0,class:"absolute -top-6 left-4 bg-white rounded-t-lg px-3 py-1 text-xs flex items-center gap-2 border border-b-0 border-x-grey-1"},rc={class:"text-gray-500"},ac={key:1,class:"absolute -top-6 left-4 bg-white rounded-t-lg px-3 py-1 text-xs flex items-center gap-2 border border-b-0 border-x-grey-1"},cc={class:"text-gray-500"},dc={class:"flex items-center gap-1.5"},uc={class:"flex-none flex items-center gap-1.5"},xc=["disabled"],hc=te(()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e("polyline",{points:"21 15 16 10 5 21"})],-1)),fc=[hc],vc={key:0,class:"relative shrink-0"}
1,pc=["aria-label","title","disabled"],gc=Ne('<svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" data-v-a82637ae><polyline points="20 12 20 22 4 22 4 12" data-v-a82637ae></polyline><rect x="2" y="7" width="20" height="5" data-v-a82637ae></rect><line x1="12" y1="22" x2="12" y2="7" data-v-a82637ae></line><path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z" data-v-a82637ae></path><path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z" data-v-a82637ae></path></svg>',1),_c=[gc],mc={key:0,"aria-hidden":"true",class:"eb-new-tag pointer-events-none absolute -right-[9px] -top-[7px] rounded-full bg-gradient-to-r from-x-pink to-x-orange px-[5px] py-[2px] text-[8px] font-extrabold leading-none tracking-[0.06em] text-white shadow-[0_2px_6px_rgba(231,64,124,0.4)]"},bc={key:1,class:"relative shrink-0"},yc=["aria-label","title","disabled"],wc=te(()=>e("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"},[e("path",{d:"M10 3.2v13.6"}),e("path",{d:"M13.2 6.6c0-1.5-1.4-2.4-3.2-2.4S6.8 5.2 6.8 6.7c0 3.6 6.4 1.9 6.4 5.6 0 1.5-1.4 2.5-3.2 2.5s-3.2-1-3.2-2.5"})],-1)),kc=[wc],$c={key:0,"aria-hidden":"true",class:"eb-new-tag pointer-events-none absolute -right-[9px] -top-[7px] rounded-full bg-gradient-to-r from-x-pink to-x-orange px-[5px] py-[2px] text-[8px] font-extrabold leading-none tracking-[0.06em] text-white shadow-[0_2px_6px_rgba(231,64,124,0.4)]"},Cc=["disabled"],Mc={key:0,class:"w-4 h-4 border-2 border-x-pink-1 border-t-transparent rounded-full animate-spin"},Sc={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Tc=te(()=>e("polygon",{points:"23 7 16 12 23 17 23 7"},null,-1)),jc=te(()=>e("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"},null,-1)),Dc=[Tc,jc],Uc=["placeholder","disabled"],Ec=["value"],Oc={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"},Bc={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Vc=te(()=>e("line",{x1:"22",y1:"2",x2:"11",y2:"13"},null,-1)),Pc=te(()=>e("polygon",{points:"22 2 15 22 11 13 2 9 22 2"},null,-1)),Nc=[Vc,Pc],Ic={key:0,class:"fixed grid w-screen h-screen-dynamic bg-overlay-background z-100 overflow-hidden box-border p-10 top-0"},Lc={class:"flex flex-col gap-6 bg-white w-full max-w-[550px] p-6 pt-8 rounded-2xl m-auto max-h-full"},Rc={class:"w-full py-4 flex flex-col items-center gap-4"},Ac=te(()=>e("div",{class:"loading-dots"},[e("span"),e("span"),e("span")],-1)),Gc={class:"text-sm text-center text-gray-700"},Hc={key:0,class:"w-full max-w-xs mt-2"},Fc={class:"flex items-center justify-center mb-2 text-xs text-gray-500"},zc={class:"w-full bg-x-grey-1 rounded-full h-1.5 overflow-hidden"},Wc=Pe({__name:"MessagesDesktop",setup(K){const v=qs(),b=u=>{if(!u||typeof u!="string")return!1;const i=u.trim();if(!i)return!1;const q=/^https?:\/\/.*\.gif(\?.*)?$/i,ge=/^https?:\/\/(media\.)?tenor\.com/i,$e=/^https?:\/\/(media\d*\.)?giphy\.com/i;return q.test(i)||ge.test(i)||$e.test(i)},j=Ot(),f=Kt(),{finish:L}=bn(),{t:r}=Ve(),D=Vt(),U=u=>u?D.isUserOnline(u):!1,{conversations:P,loading:S,currentUser:H,isLoading:se,loadingMessage:Q,handlePendingConversation:Y,isInboxEmpty:ne,messageStore:R}=Ks(),{pendingRecipientId:y,currentConversationId:h}=Be(R),c=yn(),m=async()=>{const u=c.selectedGift;if(!(!u||!A.value)){c.isSending=!0;try{await R.sendGiftMessage(A.value,u.id),c.closeGiftPicker()}catch(i){if(Os(i)===402){c.openShortfallModal(u);return}Ee.error(r("account.conversations.gift.sendFailed"))}finally{c.isSending=!1}}},N=wn(),{isVisible:F,dismiss:z}=Es(Et.CHAT_GIFT_NEW_BADGE_DISMISSED),{isVisible:G,dismiss:k}=Es(Et.CHAT_TIP_NEW_BADGE_DISMISSED),$=()=>{z(),c.openGiftPicker()},w=()=>{k(),N.openTipSheet()},M=async()=>{const u=N.amount;if(!(!u||!A.value)){N.isSending=!0;try{await R.sendTipMessage(A.value,u),N.closeTipSheet()}
1catch(i){if(Os(i)===402){N.openShortfallModal(u);return}Ee.error(r("account.conversations.tip.sendFailed"))}finally{N.isSending=!1}}},B=u=>!H.value||!u.initiator_user||!u.recipient_user?null:u.initiator_user.username===H.value.username?u.recipient_user:u.initiator_user,oe=W(()=>P.value.filter(u=>u.initiator_user&&u.recipient_user)),T=C(!1),he=C("");let me=null;xe(he,u=>{me&&clearTimeout(me),me=setTimeout(()=>{R.fetchConversations(void 0,u.trim())},300)});async function be(){await R.fetchMoreConversations()}const Ce=W(()=>{let u=[...oe.value];return T.value&&(u=u.filter(i=>{const q=B(i);return q&&D.isUserOnline(q.id)})),u.sort((i,q)=>{var rt,at;const ge=B(i),$e=B(q),nt=D.onlineUsers[(ge==null?void 0:ge.id)??-1],ot=D.onlineUsers[($e==null?void 0:$e.id)??-1],it=ge&&(nt!==void 0?nt:i.other_user_is_online===!0),lt=$e&&(ot!==void 0?ot:q.other_user_is_online===!0);if(it&&!lt)return-1;if(!it&&lt)return 1;const Tt=((rt=i.last_message)==null?void 0:rt.created_at)||i.updated_at,jt=((at=q.last_message)==null?void 0:at.created_at)||q.updated_at;return new Date(jt).getTime()-new Date(Tt).getTime()})}),Ze=W(()=>oe.value.filter(u=>{const i=B(u);return i&&D.isUserOnline(i.id)}).length),A=C(null);j.params.id&&(A.value=Number(j.params.id));const{message:ve,showContentModal:We,contentModalMediaType:Je,messagesContainer:Me,messageEndRef:Se,otherUser:a,isInternal:l,isConversationBlocked:I,currentConversation:V,messagesByDate:le,hasNoMessages:ce,loading:Z,isScrolling:wt,canMessageBack:qe,postMessage:g,loadEarlierMessages:p,hasCompletedInitialScroll:X,sendTypingIndicator:ye,handlePhotoButtonClick:_,handleVideoUpload:Te,uploadingVideo:fe,uploadProgress:je,sendingVideoMessage:we,showThumbnailPicker:Ie,uploadedVideoData:pe,handleThumbnailSelected:Le,handleThumbnailCanceled:Re,isUserPunter:Ae,messageStore:ke,userStore:Xe}=Hn(A),kt=u=>{A.value=u,f.push(`/users/account/messages/${u}`)},et=W(()=>A.value!==null),Pt=W(()=>
1y.value!==null),de=C("messages"),tt=u=>{de.value=u},Ke=C("chat"),Nt=C(!0),Qt=u=>{Ke.value=u},Js=()=>{Nt.value=!1,Ds.setItem(Et.CHAT_PROMO_BANNER_DISMISSED,"true")},Zt=W(()=>!!Xe.hasRole(Qe.ESCORT)||!!Xe.hasRole(Qe.VENUE)),Xs=W(()=>Zt.value?r("account.chatPromoBanner.escortVenue"):r("account.chatPromoBanner.punter")),en=(u,i)=>{const q=B(i);q!=null&&q.profile_url&&(u.stopPropagation(),window.open(q.profile_url,"_blank"))},tn=u=>{var q;const i=u.target;if(X.value&&!wt.value&&!Z.value.messages&&!Z.value.loadingEarlier&&i.scrollTop===0&&A.value){const ge=A.value;(q=ke.pagination[ge])!=null&&q.hasMore&&p()}};xe(()=>j.params.id,u=>{u?(A.value=Number(u),R.clearPendingRecipient(),de.value="messages"):A.value=null}),xe(()=>Z.value.messages,u=>{u||L()});const Jt=()=>{const u=oe.value.map(i=>{const q=B(i);return q==null?void 0:q.id}).filter(i=>!!i);u.length>0&&D.fetchOnlineStatus(u)};xe(oe,()=>{Jt()},{immediate:!1}),xe(y,u=>{u!==null&&(de.value="messages",A.value=null)},{immediate:!0}),xe(h,(u,i)=>{u&&u!==i&&(A.value=u,Number(j.params.id)!==u&&f.push(`/users/account/messages/${u}`))}),ze(async()=>{Ds.getItem(Et.CHAT_PROMO_BANNER_DISMISSED)==="true"&&(Nt.value=!1),await R.fetchConversations(),Jt(),j.params.id||await Y()});const{previewFor:sn}=Ys(),nn=u=>u?u.replace(/<[^>]*>/g,""):"",$t=C(!1),Ct=C(!1),Mt=C(!1),re=C(null),St=C(!1),st=C(null),Ye=C(null),Xt=W(()=>ke.isConversationBlocked),on=()=>{var i;const u=(i=re.value)==null?void 0:i.id;$t.value=!1,re.value=null,A.value===u&&(A.value=null,f.push("/users/account/messages"))},es=async u=>{var q;Ct.value=!1;const i=(q=re.value)==null?void 0:q.id;re.value=null,u&&i&&(await R.fetchConversations(i),A.value===i&&await ke.fetchMessages(i))},ln=()=>{!A.value||!a.value||(re.value={id:A.value,userName:a.value.username,userId:a.value.id},Ct.value=!0)},rn=()=>{!A.value||!a.value||(re.value={id:A.value,userName:a.value.username,userId:a.value.id},Mt.value=!0)},an=async()=>{Mt.value=!1,await es(!0)},cn=()=>{!A.value||!a.value||(re.value={id:A.value,userName:a.value.display_name||a.value.username,userId:a.value.id},$t.value=!0)},dn=async()=>{if(A.value)try{await ke.unblockUser(A.value),Ee.success(r("inbox.userUnblocked"))}catch(u){console.error("Failed to unblock user:",u),Ee.error(r("inbox.failedToUnblockUser"))}},It=u=>{st.value=u,St.value=!0},un=()=>{var u;(u=a.value)!=null&&u.profile_url&&window.open(a.value.profile_url,"_blank")},xn=()=>{St.value=!1,st.value=null},Lt=u=>{var q;if(u.type!=="self"||u.isTemporary||!((q=u.originalMessage)!=null&&q.id))return!1;const i=u.originalMessage;return!(i.message_type==="gift"||i.message_type==="tip"||(i.message_type==="image"||i.message_type==="video")&&i.price!==void 0&&i.price>0&&i.is_unlocked===!0)};return(u,i)=>{var q,ge,$e,nt,ot,it,lt,Tt,jt,rt,at,ts,ss,ns,os,is,ls,rs,as,cs,ds,us,xs,hs,fs,vs,ps,gs,_s,ms,bs,ys;return s(),n("div",Cl,[t(se)?(s(),n("div",Ml,[Sl,e("p",Tl,o(t(Q)),1)])):(s(),n("div",jl,[e("div",Dl,[Zt.value?(s(),n("div",Ul,[e("button",{onClick:i[0]||(i[0]=x=>tt("messages")),class:O(["text-sm px-4 py-2.5 relative transition-colors cursor-pointer",de.value==="messages"?"text-x-pink-1 font-semibold":"text-x-grey-15 hover:text-x-grey-20"])},[ie(o(t(r)("account.messages"))+" ",1),de.value==="messages"?(s(),n("span",El)):d("",!0)],2),e("button",{onClick:i[1]||(i[1]=x=>tt("profile-views")),class:O(["text-sm px-4 py-2.5 relative transition-colors cursor-pointer",de.value==="profile-views"?"text-x-pink-1 font-semibold":"text-x-grey-15 hover:text-x-grey-20"])},[ie(o(t(r)("account.profileViews"))+" ",1),de.value==="profile-views"?(s(),n("span",Ol)):d("",!0)],2),e("button",{onClick:i[2]||(i[2]=x=>tt("purchased-galleries")),class:O(["text-sm px-4 py-2.5 relative transition-colors cursor-pointer",de.value==="purchased-galleries"?"text-x-pink-1 font-semibold":"text-x-grey-15 hover:text-x-grey-20"])},[ie(o(t(r)("account.purchasedGalleries"))+" ",1),de.value==="purchased-galleries"?(s(),n("span",Bl)):d("",!0)],2)])):(s(),n("div",Vl,[e("button",{onClick:i[3]||(i[3]=x=>tt("messages")),class:O(["text-sm px-4 py-2.5 relative transition-colors cursor-pointer",de.value==="messages"?"text-x-pink-1 font-semibold":"text-x-grey-15 hover:text-x-grey-20"])},[ie(o(t(r)("account.messages"))+" ",1),de.value==="messages"?(s(),n("span",Pl)):d("",!0)],2),e("button",{onClick:i[4]||(i[4]=x=>tt("blocked-users")),class:O(["text-sm px-4 py-2.5 relative transition-colors cursor-pointer",de.value==="blocked-users"?"text-x-pink-1 font-semibold":"text-x-grey-15 hover:text-x-grey-20"])},[ie(o(t(r)("account.conversations.blockedUsers"))+" ",1),de.value==="blocked-users"?(s(),n("span",Nl)):d("",!0)],2)])),de.value==="messages"&&et.value?(s(),n("div",Il,[e
1("button",{onClick:i[5]||(i[5]=x=>Qt("chat")),class:O(["text-sm px-6 py-2.5 relative transition-colors cursor-pointer",Ke.value==="chat"?"text-x-pink-1 font-semibold":"text-x-grey-15 hover:text-x-grey-20"])},[ie(o(t(r)("inbox.chat"))+" ",1),Ke.value==="chat"?(s(),n("span",Ll)):d("",!0)],2),e("button",{onClick:i[6]||(i[6]=x=>Qt("media")),class:O(["text-sm px-6 py-2.5 relative transition-colors cursor-pointer",Ke.value==="media"?"text-x-pink-1 font-semibold":"text-x-grey-15 hover:text-x-grey-20"])},[ie(o(t(r)("inbox.media"))+" ",1),Ke.value==="media"?(s(),n("span",Rl)):d("",!0)],2)])):d("",!0)]),de.value==="blocked-users"?(s(),n("div",Al,[e("div",Gl,[Hl,J(zs)])])):de.value==="profile-views"?(s(),n("div",Fl,[e("div",zl,[J(Qs,{class:"w-full"})])])):de.value==="purchased-galleries"?(s(),n("div",Wl,[e("div",ql,[J(Zs,{class:"w-full"})])])):(s(),n(ae,{key:3},[Nt.value?(s(),n("div",Kl,[e("span",Yl,o(Xs.value),1),e("button",{onClick:Js,class:"shrink-0 p-1 hover:bg-white/20 rounded absolute right-4"},Zl)])):d("",!0),t(S).conversations?(s(),n("div",Jl,[e("div",Xl,[er,e("p",tr,o(t(r)("inbox.loadingConversations")),1)])])):t(ne)()?(s(),n("div",sr,[e("div",nr,[or,e("span",ir,o(t(r)("inbox.inboxEmpty")),1),e("span",lr,o(t(r)("inbox.noMessages")),1)])])):(s(),n("div",rr,[e("div",ar,[e("div",cr,[e("div",dr,[He(e("input",{"onUpdate:modelValue":i[7]||(i[7]=x=>he.value=x),type:"search",placeholder:"Search conversations…",class:"w-full h-9 px-3 text-xs rounded-lg border border-x-grey-1 focus-visible:outline-none focus-visible:shadow-light-grey placeholder:text-x-grey-15"},null,512),[[Fe,he.value]])]),e("div",ur,[e("span",xr,o(Ce.value.length)+" "+o(T.value?t(r)("account.onlineConversations"):t(r)("account.conversationsLabel")),1),e("div",hr,[e("button",{onClick:i[8]||(i[8]=x=>T.value=!1),class:O(["text-xs px-3 py-1 rounded-full transition-colors",T.value?"bg-x-grey-2 text-x-grey-15 hover:bg-x-grey-4":"bg-x-pink-1 text-white"])},o(t(r)("account.showAll"))+" ("+o(oe.value.length)+") ",3),e("button",{onClick:i[9]||(i[9]=x=>T.value=!0),class:O(["text-xs px-3 py-1 rounded-full transition-colors",T.value?"bg-x-green-4 text-x-green-5":"bg-x-grey-2 text-x-grey-15 hover:bg-x-grey-4"])},o(t(r)("account.onlineOnly"))+" ("+o(Ze.value)+") ",3)])]),Ce.value.length===0&&T.value?(s(),n("div",fr,[vr,e("span",pr,o(t(r)("account.noOnlineConversations")),1),e("span",gr,o(t(r)("account.noOnlineConversationsDescription")),1),e("button",{onClick:i[10]||(i[10]=x=>T.value=!1),class:"mt-4 text-xs px-4 py-2 rounded-full bg-x-pink-1 text-white"},o(t(r)("account.showAll")),1)])):(s(),n("div",_r,[(s(!0),n(ae,null,_e(Ce.value,x=>{var E,ct,dt,ut,xt,ht,ft,vt,pt,gt,_t,mt;return s(),n("div",{key:x.id,class:O(["group relative w-full flex items-center p-4 gap-4 border-b border-x-grey-23 hover:bg-x-grey-2 transition-colors text-left cursor-pointer",{"!bg-x-grey-4":A.value===x.id}]),onClick:bt=>kt(x.id)},[e("div",br,[e("div",{onClick:bt=>en(bt,x),class:O(["w-10 h-10 rounded-full shrink-0 overflow-hidden",{"curs
1or-pointer hover:opacity-80 transition-opacity":(E=B(x))==null?void 0:E.profile_url}])},[(ct=B(x))!=null&&ct.photo_url?(s(),n("img",{key:0,src:B(x).photo_url,alt:B(x).display_name||B(x).username,class:"w-full h-full object-cover"},null,8,wr)):(s(),n("span",{key:1,class:O(["flex items-center justify-center w-full h-full bg-x-pink-1/10 text-x-pink-2",{"!bg-x-pink-1 !text-white":t(Ge)((dt=B(x))==null?void 0:dt.username)}])},[t(Ge)((ut=B(x))==null?void 0:ut.username)?(s(),n("span",kr,"E")):(s(),n("span",$r,o((((xt=B(x))==null?void 0:xt.display_name)||((ht=B(x))==null?void 0:ht.username)||"?").substring(0,1)),1))],2))],10,yr),U((ft=B(x))==null?void 0:ft.id)&&!x.has_blocked&&!x.blocked?(s(),n("span",Cr)):d("",!0),(x.has_blocked||x.blocked)&&!t(Ge)((vt=B(x))==null?void 0:vt.username)?(s(),n("div",{key:1,class:"absolute inset-0 bg-black/50 rounded-full flex items-center justify-center",title:x.has_blocked?t(r)("account.conversations.youBlockedThisUser"):t(r)("account.conversations.blocked")},Tr,8,Mr)):d("",!0)]),e("div",jr,[e("div",Dr,[e("div",Ur,[e("span",Er,o(x.initiator_user.username===((pt=t(H))==null?void 0:pt.username)?x.recipient_user.display_name||x.recipient_user.username:x.initiator_user.display_name||x.initiator_user.username),1),(gt=B(x))!=null&&gt.is_admin?(s(),n("span",Or,o(t(r)("inbox.admin")),1)):d("",!0),(_t=B(x))!=null&&_t.is_gold?(s(),n("span",Br,o(t(r)("inbox.vip")),1)):d("",!0)]),t(Ae)?d("",!0):(s(),n("span",Vr,o(t(v)(x.last_message?x.last_message.read_sent_time||x.last_message.created_at:x.updated_at)),1))]),e("div",Pr,[e("p",Nr,o(nn(t(sn)(x,((mt=t(H))==null?void 0:mt.id)||0))),1),x.unseen_count>0?(s(),n("div",Ir,o(x.unseen_count),1)):d("",!0)])])],10,mr)}),128)),!T.value&&t(R).conversationsHasMore?(s(),n("div",Lr,[e("button",{type:"button",class:"px-4 py-1.5 text-xs font-medium text-x-pink-1 border border-x-pink-1 rounded hover:bg-x-pink-1 hover:text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",disabled:t(R).loading.conversationsMore,onClick:be},[t(R).loading.conversationsMore?(s(),n("span",Ar)):d("",!0),ie(" "+o(t(R).loading.conversationsMore?"Loading…":"Load more"),1)],8,Rr)])):d("",!0)]))]),e("div",Gr,[Pt.value?(s(),n("div",Hr,[e("div",Fr,[zr,e("span",Wr,o(t(r)("account.newConversation")),1),e("span",qr,o(t(r)("account.newConversationDescription")),1)]),e("div",Kr,[e("div",Yr,[He(e("input",{"onUpdate:modelValue":i[11]||(i[11]=x=>Us(ve)?ve.value=x:null),class:"flex-auto h-10 text-black placeholder:text-black px-4 text-xs rounded-2xl border border-x-grey-1 shadow focus-visible:outline-none focus-visible:shadow-light-grey",placeholder:t(r)("account.enterYourMessage"),disabled:t(Z).sending,onKeyup:i[12]||(i[12]=Ht((...x)=>t(g)&&t(g)(...x),["enter"]))},null,40,Qr),[[Fe,t(ve)]]),J(Wt,{onClick:i[13]||(i[13]=x=>t(g)()),class:"flex-none p-0 !min-h-0 h-10 w-10 flex items-center justify-center",disabled:t(Z).sending||!t(ve).trim()},{default:Oe(()=>[t(Z).sending?(s(),n("div",Zr)):(s(),n("svg",Jr,ta))]),_:1},8,["disabled"])])])])):et.value?(s(),n("div",la,[e("div",ra,[e("div",aa,[e("div",ca,[e("div",{class:O(["w-10 h-10 rounded-full shrink-0 overflow-hidden",{"curs
1or-pointer hover:opacity-80 transition-opacity":(q=t(a))==null?void 0:q.profile_url}]),onClick:un},[(ge=t(a))!=null&&ge.photo_url?(s(),n("img",{key:0,src:t(a).photo_url,alt:t(a).display_name||t(a).username,class:"w-full h-full object-cover"},null,8,da)):(s(),n("span",{key:1,class:O(["flex items-center justify-center w-full h-full bg-x-pink-1/10 text-x-pink-2",{"!bg-x-pink-1 !text-white":t(l)}])},[t(l)?(s(),n("span",ua,"E")):(s(),n("span",xa,o(((($e=t(a))==null?void 0:$e.display_name)||((nt=t(a))==null?void 0:nt.username)||"?").substring(0,1)),1))],2))],2),t(a)&&U(t(a).id)&&!Xt.value&&!((ot=t(V))!=null&&ot.has_blocked)?(s(),n("span",ha)):d("",!0),(Xt.value||(it=t(V))!=null&&it.has_blocked)&&!t(l)?(s(),n("div",{key:1,class:"absolute inset-0 bg-black/50 rounded-full flex items-center justify-center",title:(lt=t(V))!=null&&lt.has_blocked?t(r)("account.conversations.youBlockedThisUser"):t(r)("account.conversations.blocked")},pa,8,fa)):d("",!0)]),e("div",ga,[e("span",_a,o(((Tt=t(a))==null?void 0:Tt.display_name)||((jt=t(a))==null?void 0:jt.username)),1),t(l)?(s(),n("span",ma,o(t(r)("inbox.support")),1)):t(a)&&U(t(a).id)?(s(),n("span",ba,o(t(r)("inbox.online")),1)):(s(),n("span",ya,o(t(r)("inbox.offline")),1))])]),t(l)?d("",!0):(s(),ee(Rs,{key:`action-menu-${(rt=t(V))==null?void 0:rt.id}-${(at=t(V))==null?void 0:at.has_blocked}`,"is-blocked":((ts=t(V))==null?void 0:ts.has_blocked)||!1,onReport:ln,onBlock:rn,onDelete:cn,onUnblock:dn},null,8,["is-blocked"]))]),Ke.value==="media"?(s(),ee(Yo,{key:0,"conversation-id":A.value},null,8,["conversation-id"])):(s(),n("div",wa,[e("div",{ref_key:"messagesContainer",ref:Me,onScroll:tn,class:"messages-container flex-1 overflow-y-auto overflow-x-hidden overscroll-behavior-contain p-6 pb-6 [scroll-padding-bottom:250px]"},[t(Z).messages?(s(),n("div",ka,[e("div",$a,[Ca,e("p",Ma,o(t(r)("inbox.loadingMessages")),1)])])):t(ce)?(s(),n("div",Sa,[Ta,e("span",ja,o(t(r)("inbox.noMessagesYet")),1),e("span",Da,o(t(r)("inbox.startConversation")),1)])):(s(),n("div",Ua,[t(Z).loadingEarlier?(s(),n("div",Ea,[e("div",Oa,[Ba,e("span",Va,o(t(r)("inbox.loadingEarlierMessages")),1)])])):d("",!0),e("div",Pa,[(s(!0),n(ae,null,_e(t(le),x=>(s(),n(ae,{key:`group-${x.date}`},[e("div",Na,[e("div",Ia,o(x.dateLabel),1),La]),(s(!0),n(ae,null,_e(x.messages,E=>{var ct,dt,ut,xt,ht,ft,vt,pt,gt,_t,mt,bt,ws,ks,$s,Cs,Ms,Ss,Ts,js;return s(),n(ae,{key:`msg-${E.id}`},[b(E.message)?(s(),n("div",{key:0,class:O(["group/message flex items-start gap-2",E.type==="self"?"justify-end":"justify-start"])},[e("div",{class:O(["flex flex-col gap-2 max-w-[280px]",E.isTemporary?"opacity-70":""])},[e("div",{class:O(["rounded-2xl overflow-hidden",E.type==="self"?"rounded-tr-none":"rounded-tl-none"])},[e("img",{src:(ct=E.message)==null?void 0:ct.trim(),alt:"GIF",class:"w-full max-h-64 object-contain bg-gray-100",loading:"lazy"},null,8,Ra)],2),e("div",{class:O(["text-[9px] opacity-70 whitespace-nowrap px-1",E.type==="self"?"text-right text-x-grey-15":"text-left text-x-grey-15"])},[E.isTemporary?(s(),n("div",{key:0,class:O(["flex items-center gap-1",E.type==="self"?"justify-end":"justify-start"])},[Aa,ie(" sending... ")],2)):(s(),n(ae,{key:1},[ie(o(t(v)(E.timestamp)),1)],64))],2)],2)],2)):((dt=E.originalMessage)==null?void 0:dt.message_type)==="gift"?(s(),n("div",Ga,[e("div",Ha,[J(Bn,{message:E.originalMessage,currentUserId:((ut=t(H))==null?void 0:ut.id)||0,showTimestamp:!0,recipientName:((xt=t(a))==null?void 0:xt.display_name)||((ht=t(a))==null?void 0:ht.username)||""},null,8,["message","currentUserId","recipientName"])])])):((ft=E.originalMessage)==null?void 0:ft.message_type)==="tip"?(s(),n("div",Fa,[e("div",za,[J(Vn,{message:E.originalMessage,currentUserId:((vt=t(H))==null?void 0:vt.id)||0,showTimestamp:!0,recipientName:((pt=t(a))==null?void 0:pt.display_name)||((gt=t(a))==null?void 0:gt.username)||""},null,8,["message","currentUserId","recipientName"])])])):((_t=E.originalMessage)==null?void 0:_t.message_type)!=="image"&&((mt=E.originalMessage)==null?void 0:mt.message_type)!=="video"&&((bt=E.originalMessage)==null?void 0:bt.message_type)!=="gift"&&((ws=E.originalMessage)==null?void 0:ws.message_type)!=="tip"?(s(),n("div",{key:3,class:O
1(["group/message flex items-start gap-2",E.type==="self"?"justify-end":"justify-start"]),onMouseenter:De=>{var Ue;return Ye.value=(Ue=E.originalMessage)==null?void 0:Ue.id},onMouseleave:i[14]||(i[14]=De=>Ye.value=null)},[Lt(E)?(s(),n("div",qa,[J(Gt,{onDelete:De=>It(E.originalMessage.id)},null,8,["onDelete"])])):d("",!0),e("div",{class:O(["flex flex-col gap-2.5 max-w-[80%] rounded-2xl p-4 bg-white text-xs break-all relative",E.type==="self"?"bg-x-pink-1 text-white rounded-tr-none":"rounded-tl-none"])},[E.type==="self"&&E.isTemporary?(s(),n("div",Ka,[e("div",null,o(E.message),1),e("div",Ya,[J(Rt,{color:"white"})])])):(s(),n("div",Qa,[($s=(ks=E.originalMessage)==null?void 0:ks.user)!=null&&$s.is_admin&&((Cs=E.originalMessage)!=null&&Cs.is_html)?(s(),n("div",{key:0,class:"pr-1.5 break-words",innerHTML:E.message},null,8,Za)):(s(),n("div",Ja,o(E.message),1)),e("div",{class:O(["text-[9px] opacity-70 whitespace-nowrap self-end flex-shrink-0",E.type==="self"?"text-white/80":"text-black/60"])},o(t(v)(E.timestamp)),3)]))],2)],42,Wa)):((Ms=E.originalMessage)==null?void 0:Ms.message_type)==="image"?(s(),n("div",{key:4,class:O(["group/message flex items-start gap-2",E.type==="self"?"justify-end":"justify-start"]),onMouseenter:De=>{var Ue;return Ye.value=(Ue=E.originalMessage)==null?void 0:Ue.id},onMouseleave:i[15]||(i[15]=De=>Ye.value=null)},[Lt(E)?(s(),n("div",ec,[J(Gt,{onDelete:De=>It(E.originalMessage.id)},null,8,["onDelete"])])):d("",!0),e("div",tc,[J(Sn,{message:E.originalMessage,currentUserId:((Ss=t(H))==null?void 0:Ss.id)||0,showTimestamp:!0},null,8,["message","currentUserId"])])],42,Xa)):((Ts=E.originalMessage)==null?void 0:Ts.message_type)==="video"?(s(),n("div",{key:5,class:O(["group/message flex items-start gap-2",E.type==="self"?"justify-end":"justify-start"]),onMouseenter:De=>{var Ue;return Ye.value=(Ue=E.originalMessage)==null?void 0:Ue.id},onMouseleave:i[16]||(i[16]=De=>Ye.value=null)},[Lt(E)?(s(),n("div",nc,[J(Gt,{onDelete:De=>It(E.originalMessage.id)},null,8,["onDelete"])])):d("",!0),e("div",oc,[J(Pn,{message:E.originalMessage,currentUserId:((js=t(H))==null?void 0:js.id)||0,showTimestamp:!0},null,8,["message","currentUserId"])])],42,sc)):d("",!0)],64)}),128))],64))),128)),e("div",{class:"messages-end h-1 w-full mb-2 scroll-mb-[250px]",ref_key:"messageEndRef",ref:Se},"​",512)])]))],544),t(l)?d("",!0):(s(),n("div",ic,[t(ke).isOtherUserTyping?(s(),n("div",lc,[e("span",rc,o(((ss=t(a))==null?void 0:ss.display_name)||((ns=t(a))==null?void 0:ns.username))+" "+o(t(r)("inbox.isTyping")),1),J(Rt,{color:"#ff5281"})])):d("",!0),t(ke).isOtherUserPreparingContent?(s(),n("div",ac,[e("span",cc,o(((os=t(a))==null?void 0:os.display_name)||((is=t(a))==null?void 0:is.username))+" "+o(t(r)("inbox.isPreparingContent")),1),J(Rt,{color:"#ff5281"})])):d("",!0),e("div",dc,[e("div",uc,[e("button",{onClick:i[17]||(i[17]=(...x)=>t(_)&&t(_)(...x)),class:"flex items-center justify-center h-10 w-10 rounded-full hover:bg-gray-100",disabled:t(Z).sending||t(I)||((ls=t(V))==null?void 0:ls.blocked)||((rs=t(V))==null?void 0:rs.has_blocked)},fc,8,xc),t(Ae)?(s(),n("div",vc,[e("button",{onClick:i[18]||(i[18]=x=>$()),class:O(["flex h-9 w-9 items-center justify-center rounded-full border-0 bg-[rgba(231,64,124,0.08)] text-x-pink-1 disabled:opacity-50",{"eb-new-button eb-new-button--gift":t(F)}]),"aria-label":t(r)("account.conversations.gift.send"),title:t(r)("account.conversations.gift.send"),disabled:t(Z).sending||t(I)||((as=t(V))==null?void 0:as.blocked)||((cs=t(V))==null?void 0:cs.has_blocked)},_c,10,pc),t(F)?(s(),n("span",mc,o(t(r)("account.conversations.newBadge")),1)):d("",!0)])):d("",!0),t(Ae)?(s(),n("div",bc,[e("button",{onClick:i[19]||(i[19]=x=>w()),class:O(["flex h-9 w-9 items-center justify-center rounded-full border-0 bg-[rgba(247,200,56,0.16)] text-[#8A6410] disabled:opacity-50",{"eb-new-button eb-new-button--tip":t(G)}]),"aria-label":t(r)("account.conversations.tip.title"),title:t(r)("account.conversations.tip.title"),disabled:t(Z).sending||t(I)||((ds=t(V))==null?void 0:ds.blocked)||((us=t(V))==null?void 0:us.has_blocked)},kc,10,yc),t(G)?(s(),n("span",$c,o(t(r)("account.conversations.newBadge")),1)):d("",!0)])):d("",!0),t(Ae)?d("",!0):(s(),n("button",{key:2,onClick:i[20]||(i[20]=(...x)=>t(Te)&&t(Te)(...x)),class:"flex items-center justify-center h-10 w-10 rounded-full hover:bg-gray-100",disabled:t(Z).sending||t(fe)||t(I)||((xs=t(V))==null?void 0:xs.blocked)||((hs=t(V))==null?void 0:hs.has_blocked)},[t(fe)?(s(),n("div",Mc)):(s(),n("svg",Sc,Dc))],8,Cc))]),!t(I)&&!((fs=t(V))!=null&&fs.blocked)&&!((vs=t(V))!=null&&vs.has_blocked)?He((s(),n("input",{key:0,"onUpdate:modelValue":i[21]||(i[21]=x=>Us(ve)?ve.value=x:null),class:"flex-auto h-10 text-black placeholder:text-black px-4 text-xs rounded-2xl border border-x-grey-1 shadow focus-visible:outline-none focus-visible:shadow-light-grey",placeholder:t(r)("account.enterYourMessage"),disabled:t(Z).sending,onInput:i[22]||(i[22]=(...x)=>t(ye)&&t(ye)(...x)),onKeyup:i[23]||(i[23]=Ht((...x)=>t(g)&&t(g)(...x),["enter"]))},null,40,Uc)),[[Fe,t(ve)]]):(s(),n("input",{key:1,class:"flex-auto h-10 text-red-500 px-4 text-xs rounded-2xl border border-red-200 bg-red-50 cursor-not-allowed",value:t(r)("account.conversations.blocked"),disabled:""},null,8,Ec)),J(Wt,{onClick:i[24]||(i[24]=x=>t(g)()),class:"flex-none p-0 !min-h-0 h-10 w-10 flex items-center justify-center",disabled:t(Z).sending||!t(ve).trim()||t(I)||((ps=t(V))==null?void 0:ps.blocked)||((gs=t(V))==null?void 0:gs.has_blocked)},{default:Oe(()=>[t(Z).sending?(s(),n("div",Oc)):(s(),n("svg",Bc,Nc))]),_:1},8,["disabled"])])]))]))])):(s(),n("div",sa,[na,e("span",oa,o(t(r)("inbox.selectConversation")),1),e("span",ia,o(t(r)("inbox.chooseConversation")),1)]))])])]))],64))])),(s(),ee(Ft,{to:"body"},[t(We)?(s(),ee(Tn,{key:0,"conversation-id":A.value,"initial-media-type":t(Je),onClose:i[25]||(i[25]=x=>We.value=!1)},null,8,["conversation-id","initial-media-type"])):d("",!0),t(Ie)&&t(pe)?(s(),ee(uo,{key:1,"conversation-id":t(pe).conversationId,"video-id":t(pe).videoId,"temp-video-id":t(pe).tempVideoId,"thumbnail-options":t(pe).thumbnailOptions,"initial-content":t(pe).content,"is-temp":t(pe).isTemp,onSelected:t(Le),onCancel:t(Re),onClose:i[26]||(i[26]=x=>Ie.value=!1)},null,8,["conversation-id","video-id","temp-video-id","thumbnail-options","initial-content","is-temp","onSelected","onCancel"])):d("",!0),t(c).isGiftPickerActive?(s(),ee(jn,{key:2,"recipient-name":((_s=t(a))==null?void 0:_s.display_name)||((ms=t(a))==null?void 0:ms.username)||"",onClose:i[27]||(i[27]=x=>t(c).closeGiftPicker()),onSend:i[28]||(i[28]=x=>m())}
1,null,8,["recipient-name"])):d("",!0),t(c).isShortfallModalActive?(s(),ee(Dn,{key:3})):d("",!0),t(N).isTipSheetActive?(s(),ee(Un,{key:4,"recipient-name":((bs=t(a))==null?void 0:bs.display_name)||((ys=t(a))==null?void 0:ys.username)||"",onClose:i[29]||(i[29]=x=>t(N).closeTipSheet()),onSend:i[30]||(i[30]=x=>M())},null,8,["recipient-name"])):d("",!0),t(N).isShortfallModalActive?(s(),ee(En,{key:5})):d("",!0),J(Ln),J(Rn),re.value?(s(),ee(As,{key:6,show:$t.value,"conversation-id":re.value.id,"user-name":re.value.userName,onClose:i[31]||(i[31]=x=>{$t.value=!1,re.value=null}),onDeleted:on},null,8,["show","conversation-id","user-name"])):d("",!0),re.value?(s(),ee(Gs,{key:7,show:Ct.value,"conversation-id":re.value.id,"user-name":re.value.userName,"user-id":re.value.userId,onClose:i[32]||(i[32]=x=>{Ct.value=!1,re.value=null}),onReported:es},null,8,["show","conversation-id","user-name","user-id"])):d("",!0),Mt.value&&re.value?(s(),ee(Hs,{key:8,"user-id":re.value.userId,"user-name":re.value.userName,onClose:i[33]||(i[33]=x=>{Mt.value=!1,re.value=null}),onBlocked:an},null,8,["user-id","user-name"])):d("",!0),st.value?(s(),ee(On,{key:9,show:St.value,"message-id":st.value,onClose:i[34]||(i[34]=x=>{St.value=!1,st.value=null}),onDeleted:xn},null,8,["show","message-id"])):d("",!0)])),(s(),ee(Ft,{to:"body"},[t(fe)||t(we)?(s(),n("div",Ic,[e("div",Lc,[e("div",Rc,[Ac,e("div",Gc,[t(we)?(s(),n(ae,{key:0},[ie(o(t(r)("inbox.sendingVideoMessage")),1)],64)):(s(),n(ae,{key:1},[ie(o(t(r)("inbox.uploadingVideoMoment")),1)],64))]),t(fe)&&!t(we)?(s(),n("div",Hc,[e("div",Fc,[e("span",null,o(t(je))+"%",1)]),e("div",zc,[e("div",{class:"bg-x-pink-1 h-full rounded-full transition-all duration-300",style:kn({width:t(je)+"%"})},null,4)])])):d("",!0)])])])):d("",!0)]))])}}}),qc=Fs(Wc,[["__scopeId","data-v-a82637ae"]]),Kc={class:"flex flex-col flex-1"},Yc={key:0,class:"absolute inset-0 z-10 flex flex-col items-center justify-center bg-white/80 backdrop-blur-sm"},Qc=e("div",{class:"w-8 h-8 border-2 border-t-transparent border-x-pink-1 rounded-full animate-spin"},null,-1),Zc={class:"mt-4 text-sm text-x-grey-15"},Jc={key:1,class:"flex flex-col flex-1"},Xc={key:0,class:"flex items-center gap-0 h-full relative"},ed={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},td={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},sd={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},nd={key:1,class:"flex items-center gap-0 h-full relative"},od={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},id={key:0,class:"absolute bottom-0 left-0 right-0 h-[2px] bg-x-pink-1"},ld={key:1,class:"container-sm flex flex-col flex-1 overflow-y-auto overflow-x-hidden bg-white p-4"},rd=e("p",{class:"text-xs text-x-grey-15 mb-3"},"People you have blocked cannot send you messages. You can unblock them at any time.",-1),ad={key:2,class:"container-sm p-0 flex flex-col flex-1 overflow-auto bg-white"},cd={key:3,class:"container-sm p-0 flex flex-col flex-1 overflow-auto bg-white"},dd={key:0,class:"absolute inset-0 z-10 flex items-center justify-center bg-white/80 backdrop-blur-sm"},ud={class:"flex flex-col items-center gap-3"},xd=e("div",{class:"w-8 h-8 border-2 border-x-pink-1 border-t-transparent rounded-full animate-spin"},null,-1),hd={class:"text-xs text-x-grey-15"},fd={key:1,class:"container-sm border-b border-x-grey-1"},vd={class:"flex flex-col items-center p-4"},pd=e("div",{class:"bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"},[e("div",{class:"w-12 h-12 flex items-center justify-center text-white"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M2.2 16.06L3.88 12 2.2 7.94l4.06-1.68L7.94 2.2 12 3.88l4.06-1.68 1.68 4.06 4.06 1.68L20.12 12l1.68 4.06-4.06 1.68-1.68 4.06L12 20.12 7.94 21.8l-1.68-4.06-4.06-1.68z"})])])],-1),gd={class:"text-sm text-black font-semibold"},_d={class:"text-xs text-x-grey-15"},md={key:2,class:"flex flex-col h-full"},bd={class:"flex-1 flex flex-col items-center justify-center p-8 bg-x-grey-2"},yd=e("div",{class:"bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"},[e("div",{class:"w-12 h-12 flex items-center justify-center text-white"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})])])],-1),wd={class:"text-sm text-black font-semibold"},kd={class:"text-xs text-x-grey-15 text-center max-w-60 mt-2"},$d={class:"flex-shrink-0 bg-white z-20 p-4 border-t border-x-grey-1"},Cd={class:"flex items-center gap-1"},Md=["placeholder","disabled"],Sd={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent roun
1ded-full animate-spin"},Td={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},jd=e("line",{x1:"22",y1:"2",x2:"11",y2:"13"},null,-1),Dd=e("polygon",{points:"22 2 15 22 11 13 2 9 22 2"},null,-1),Ud=[jd,Dd],Ed={key:3,class:"container-sm p-0 flex flex-col overflow-auto"},Od={class:"px-4 py-2 bg-white border-b border-x-grey-1 flex-shrink-0"},Bd={class:"flex items-center justify-between px-4 py-2 bg-white border-b border-x-grey-1 flex-shrink-0"},Vd={class:"text-xs text-x-grey-15"},Pd={class:"flex items-center gap-1"},Nd={key:0,class:"flex-1 flex flex-col items-center justify-center p-8 bg-white"},Id=Ne('<div class="bg-gradient-vertical-light-pink p-4 rounded-xl mb-4"><div class="w-12 h-12 flex items-center justify-center text-white"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg></div></div>',1),Ld={class:"text-sm text-black font-semibold"},Rd={class:"text-xs text-x-grey-15 text-center mt-2"},Ad={key:1,class:"flex flex-col items-stretch"},Gd={class:"bg-white overflow-auto"},Hd={class:"relative"},Fd=["onClick"],zd=["src","alt"],Wd={key:0,class:"text-lg font-bold"},qd={key:1,class:"uppercase text-sm"},Kd={key:0,class:"absolute bottom-0 right-0 w-3 h-3 bg-x-green-1 border-2 border-white rounded-full"},Yd={key:1,class:"absolute inset-0 bg-black/50 rounded-full flex items-center justify-center"},Qd=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"text-white"},[e("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})],-1),Zd=[Qd],Jd={class:"flex flex-col gap-2 flex-1 min-w-0"},Xd={class:"flex items-center justify-between min-w-0"},eu={class:"flex items-center gap-2 min-w-0 flex-1 overflow-hidden"},tu={class:"text-sm text-black leading-none truncate flex-1 min-w-0"},su={key:0,class:"badge-green text-xxs px-2 py-0.5 rounded-full flex-shrink-0"},nu={key:1,class:"badge-gold text-xxs px-2 py-0.5 rounded-full flex-shrink-0"},ou={key:0,class:"text-xs text-x-grey-15 leading-none flex-shrink-0 ml-2"},iu={class:"flex items-center gap-2 min-w-0"},lu={class:"text-xs text-x-grey-15 truncate flex-1 min-w-0"},ru={key:0,class:"flex items-center justify-center ml-auto bg-x-pink-1 text-white text-xxs rounded-full min-w-[18px] h-[18px] px-1"},au={key:0,class:"flex-shrink-0"},cu={key:0,class:"flex justify-center py-3"},du=["disabled"],uu={key:0,class:"animate-spin rounded-full h-3 w-3 border-b border-x-pink-1"},xu=Pe({__name:"MessagesMobile",setup(K){const v=qs(),b=Ot(),j=Kt(),{t:f}=Ve(),L=Bt(),r=Vt(),D=W(()=>!!L.hasRole(Qe.ESCORT)||!!L.hasRole(Qe.VENUE)),U=W(()=>!!L.hasRole(Qe.PUNTER)),P=g=>g?r.isUserOnline(g):!1,S=C("messages"),H=g=>{S.value=g},{conversations:se,loading:Q,currentUser:Y,isLoading:ne,loadingMessage:R,handlePendingConversation:y,isInboxEmpty:h,isInMessageThread:c,messageStore:m}=Ks(),{pendingRecipientId:N,currentConversationId:F}=Be(m),z=W(()=>se.value.filter(g=>g.initiator_user&&g.recipient_user)),G=C(!1),k=C("");let $=null;xe(k,g=>{$&&clearTimeout($),$=setTimeout(()=>{m.fetchConversations(void 0,g.trim())},300)});async function w(){await m.fetchMoreConversations()}const M=C(null),B=g=>M.value===g,oe=(g,p)=>{p?M.value=g:M.value===g&&(M.value=null)},T=g=>!Y.value||!g.initiator_user||!g.recipient_user?null:g.initiator_user.username===Y.value.username?g.recipient_user:g.initiator_user,he=W(()=>{let g=[...z.value];return G.value&&(g=g.filter(p=>{const X=T(p);return X&&r.isUserOnline(X.id)})),g.sort((p,X)=>{var Le,Re;const ye=T(p),_=T(X),Te=r.onlineUsers[(ye==null?void 0:ye.id)??-1],fe=r.onlineUsers[(_==null?void 0:_.id)??-1],je=ye&&(Te!==void 0?Te:p.other_user_is_online===!0),we=_&&(fe!==void 0?fe:X.other_user_is_online===!0);if(je&&!we)return-1;if(!je&&we)return 1;const Ie=((Le=p.last_message)==null?void 0:Le.created_at)||p.updated_at,pe=((Re=X.last_message)==null?void 0:Re.created_at)||X.updated_at;return new Date(pe).getTime()-new Date(Ie).getTime()})}),me=W(()=>z.value.filter(g=>{const p=T(g);return p&&r.isUserOnline(p.id)}).length),be=(g,p)=>{const X=T(p);X!=null&&X.profile_url&&(g.preventDefault(),g.stopPropagation(),window.open(X.profile_url,"_blank"))},Ce=()=>{const g=z.value.map(p=>{const X=T(p);return X==null?void 0:X.id}).filter(p=>!!p);g.length>0&&r.fetchOnlineStatus(g)};xe(z,()=>{Ce()},{immediate:!1}),xe(N,g=>{g!==null&&(S.value="messages")},{immediate:!0});const Ze=W(()=>N.value!==null),A=C(""),ve=async()=>
1{if(!A.value.trim()||!N.value)return;const g=A.value;A.value="",await m.sendMessage(g)};xe(F,(g,p)=>{g&&g!==p&&Number(b.params.id)!==g&&j.push(`/users/account/messages/${g}`)}),ze(async()=>{await m.fetchConversations(),Ce(),b.params.id||await y()});const{previewFor:We}=Ys(),Je=g=>g?g.replace(/<[^>]*>/g,""):"",Me=C(!1),Se=C(!1),a=C(!1),l=C(null),I=g=>{const p=T(g);p&&(l.value={id:g.id,userName:p.username,userId:p.id},Se.value=!0)},V=g=>{const p=T(g);p&&(l.value={id:g.id,userName:p.username,userId:p.id},a.value=!0)},le=async()=>{a.value=!1,await qe(!0)},ce=g=>{const p=T(g);p&&(l.value={id:g.id,userName:p.display_name||p.username,userId:p.id},Me.value=!0)},Z=async g=>{try{await m.unblockUser(g.id),Ee.success(f("inbox.userUnblocked"))}catch(p){console.error("Failed to unblock user:",p),Ee.error(f("inbox.failedToUnblockUser"))}},wt=()=>{Me.value=!1,l.value=null},qe=g=>{Se.value=!1,l.value=null,g&&m.fetchConversations()};return(g,p)=>{const X=$n,ye=Cn;return s(),n("div",Kc,[t(ne)?(s(),n("div",Yc,[Qc,e("p",Zc,o(t(R)),1)])):(s(),n("div",Jc,[e("div",{class:O(["flex items-center gap-4 px-4 py-4 border-b border-x-grey-1 sticky top-0 bg-white z-20",{hidden:t(c)()}])},[D.value?(s(),n("div",Xc,[e("button",{onClick:p[0]||(p[0]=_=>H("messages")),class:O(["text-sm px-3 py-2 relative transition-colors cursor-pointer",S.value==="messages"?"text-x-pink-1 font-semibold":"text-x-grey-15"])},[ie(o(t(f)("account.messages"))+" ",1),S.value==="messages"?(s(),n("span",ed)):d("",!0)],2),e("button",{onClick:p[1]||(p[1]=_=>H("profile-views")),class:O(["text-sm px-3 py-2 relative transition-colors cursor-pointer",S.value==="profile-views"?"text-x-pink-1 font-semibold":"text-x-grey-15"])},[ie(o(t(f)("account.profileViews"))+" ",1),S.value==="profile-views"?(s(),n("span",td)):d("",!0)],2),e("button",{onClick:p[2]||(p[2]=_=>H("purchased-galleries")),class:O(["text-sm px-3 py-2 relative transition-colors cursor-pointer",S.value==="purchased-galleries"?"text-x-pink-1 font-semibold":"text-x-grey-15"])},[ie(o(t(f)("account.purchasedGalleries"))+" ",1),S.value==="purchased-galleries"?(s(),n("span",sd)):d("",!0)],2)])):(s(),n("div",nd,[e("button",{onClick:p[3]||(p[3]=_=>H("messages")),class:O(["text-sm px-3 py-2 relative transition-colors cursor-pointer",S.value==="messages"?"text-x-pink-1 font-semibold":"text-x-grey-15"])},[ie(o(t(f)("account.messages"))+" ",1),S.value==="messages"?(s(),n("span",od)):d("",!0)],2),e("button",{onClick:p[4]||(p[4]=_=>H("blocked-users")),class:O(["text-sm px-3 py-2 relative transition-colors cursor-pointer",S.value==="blocked-users"?"text-x-pink-1 font-semibold":"text-x-grey-15"])},[ie(o(t(f)("account.conversations.blockedUsers"))+" ",1),S.value==="blocked-users"?(s(),n("span",id)):d("",!0)],2)]))],2),t(c)()?(s(),ee(X,{key:0})):S.value==="blocked-users"?(s(),n("div",ld,[rd,J(zs,{class:"flex-1"})])):S.value==="profile-views"?(s(),n("div",ad,[J(Qs,{class:"flex-1"})])):S.value==="purchased-galleries"?(s(),n("div",cd,[J(Zs,{class:"flex-1"})])):S.value==="messages"?(s(),n(ae,{key:4},[t(Q).conversations?(s(),n("div",dd,[e("div",ud,[xd,e("p",hd,o(t(f)("inbox.loadingConversations")),1)])])):t(h)()?(s(),n("div",fd,[e("div",vd,[pd,e("span",gd,o(t(f)("inbox.inboxEmpty")),1),e("span",_d,o(t(f)("inbox.noMessages")),1)])])):Ze.value?(s(),n("div",md,[e("div",bd,[yd,e("span",wd,o(t(f)("account.newConversation")),1),e("span",kd,o(t(f)("account.newConversationDescription")),1)]),e("div",$d,[e("div",Cd,[He(e("input",{"onUpdate:modelValue":p[5]||(p[5]=_=>A.value=_),class:"flex-auto h-10 text-black placeholder:text-black px-4 text-xs rounded-2xl border border-x-grey-1 shadow focus-visible:outline-none focus-visible:shadow-light-grey",placeholder:t(f)("account.enterYourMessage"),disabled:t(Q).sending,onKeyup:Ht(ve,["enter"])},null,40,Md),[[Fe,A.value]]),J(Wt,{onClick:p[6]||(p[6]=_=>ve()),class:"flex-none p-0 !min-h-0 h-10 w-10 flex items-center justify-center",disabled:t(Q).sending||!A.value.trim()},{default:Oe(()=>[t(Q).sending?(s(),n("div",Sd)):(s(),n("svg",Td,Ud))]),_:1},8,["disabled"])])])])):(s(),n("div",Ed,[e("div",Od,[He(e("input",{"onUpdate:modelValue":p[7]||(p[7]=_=>k.value=_),type:"search",placeholder:"Search conversations…",class:"w-full h-9 px-3 text-xs rounded-lg border border-x-grey-1 focus-visible:outline-none focus-visible:shadow-light-grey placeholder:text-x-grey-15"},null,512),[[Fe,k.value]])]),e("div",Bd,[e("span",Vd,o(he.value.length)+" "+o(G.value?t(f)("account.onlineConversations"):t(f)("account.conversationsLabel")),1),e("div",Pd,[e("button",{onClick:p[8]||(p[8]=_
1=>G.value=!1),class:O(["text-xs px-3 py-1 rounded-full transition-colors",G.value?"bg-x-grey-2 text-x-grey-15 hover:bg-x-grey-4":"bg-x-pink-1 text-white"])},o(t(f)("account.showAll"))+" ("+o(z.value.length)+") ",3),e("button",{onClick:p[9]||(p[9]=_=>G.value=!0),class:O(["text-xs px-3 py-1 rounded-full transition-colors",G.value?"bg-x-green-4 text-x-green-5":"bg-x-grey-2 text-x-grey-15 hover:bg-x-grey-4"])},o(t(f)("account.onlineOnly"))+" ("+o(me.value)+") ",3)])]),he.value.length===0&&G.value?(s(),n("div",Nd,[Id,e("span",Ld,o(t(f)("account.noOnlineConversations")),1),e("span",Rd,o(t(f)("account.noOnlineConversationsDescription")),1),e("button",{onClick:p[10]||(p[10]=_=>G.value=!1),class:"mt-4 text-xs px-4 py-2 rounded-full bg-x-pink-1 text-white"},o(t(f)("account.showAll")),1)])):(s(),n("div",Ad,[e("div",Gd,[(s(!0),n(ae,null,_e(he.value,_=>{var Te;return s(),n("div",{key:_.id,class:"relative flex items-center p-4 gap-4 border-b border-x-grey-23 even:bg-x-grey-2"},[J(ye,{to:`/users/account/messages/${_.id}`,class:"flex items-center gap-4 flex-1 min-w-0"},{default:Oe(()=>{var fe,je,we,Ie,pe,Le,Re,Ae,ke,Xe,kt,et;return[e("div",Hd,[e("div",{onClick:Pt=>be(Pt,_),class:O(["w-10 h-10 rounded-full shrink-0 overflow-hidden",{"curs
1or-pointer hover:opacity-80 transition-opacity":(fe=T(_))==null?void 0:fe.profile_url}])},[(je=T(_))!=null&&je.photo_url?(s(),n("img",{key:0,src:T(_).photo_url,alt:T(_).display_name||T(_).username,class:"w-full h-full object-cover"},null,8,zd)):(s(),n("span",{key:1,class:O(["flex items-center justify-center w-full h-full bg-x-pink-1/10 text-x-pink-2",{"!bg-x-pink-1 !text-white":t(Ge)((we=T(_))==null?void 0:we.username)}])},[t(Ge)((Ie=T(_))==null?void 0:Ie.username)?(s(),n("span",Wd,"E")):(s(),n("span",qd,o((((pe=T(_))==null?void 0:pe.display_name)||((Le=T(_))==null?void 0:Le.username)||"?").substring(0,1)),1))],2))],10,Fd),P((Re=T(_))==null?void 0:Re.id)&&!_.has_blocked&&!_.blocked?(s(),n("span",Kd)):d("",!0),(_.has_blocked||_.blocked)&&!t(Ge)((Ae=T(_))==null?void 0:Ae.username)?(s(),n("div",Yd,Zd)):d("",!0)]),e("div",Jd,[e("div",Xd,[e("div",eu,[e("span",tu,o(_.initiator_user.username===((ke=t(Y))==null?void 0:ke.username)?_.recipient_user.display_name||_.recipient_user.username:_.initiator_user.display_name||_.initiator_user.username),1),(Xe=T(_))!=null&&Xe.is_admin?(s(),n("span",su,o(t(f)("inbox.admin")),1)):d("",!0),(kt=T(_))!=null&&kt.is_gold?(s(),n("span",nu,o(t(f)("inbox.vip")),1)):d("",!0)]),U.value?d("",!0):(s(),n("span",ou,o(t(v)(_.last_message?_.last_message.read_sent_time||_.last_message.created_at:_.updated_at)),1))]),e("div",iu,[e("p",lu,o(Je(t(We)(_,((et=t(Y))==null?void 0:et.id)||0))),1),_.unseen_count>0?(s(),n("div",ru,o(_.unseen_count),1)):d("",!0)])])]}),_:2},1032,["to"]),t(Ge)((Te=T(_))==null?void 0:Te.username)?d("",!0):(s(),n("div",au,[(s(),ee(Rs,{key:`action-menu-${_.id}-${_.has_blocked}`,"is-blocked":_.has_blocked||!1,"model-value":B(_.id),"onUpdate:modelValue":fe=>oe(_.id,fe),onReport:fe=>I(_),onBlock:fe=>V(_),onDelete:fe=>ce(_),onUnblock:fe=>Z(_)},null,8,["is-blocked","model-value","onUpdate:modelValue","onReport","onBlock","onDelete","onUnblock"]))]))])}),128)),!G.value&&t(m).conversationsHasMore?(s(),n("div",cu,[e("button",{type:"button",class:"px-4 py-1.5 text-xs font-medium text-x-pink-1 border border-x-pink-1 rounded hover:bg-x-pink-1 hover:text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",disabled:t(m).loading.conversationsMore,onClick:w},[t(m).loading.conversationsMore?(s(),n("span",uu)):d("",!0),ie(" "+o(t(m).loading.conversationsMore?"Loading…":"Load more"),1)],8,du)])):d("",!0)])]))]))],64)):d("",!0)])),(s(),ee(Ft,{to:"body"},[l.value?(s(),ee(As,{key:0,show:Me.value,"conversation-id":l.value.id,"user-name":l.value.userName,onClose:p[11]||(p[11]=_=>{Me.value=!1,l.value=null}),onDeleted:wt},null,8,["show","conversation-id","user-name"])):d("",!0),l.value?(s(),ee(Gs,{key:1,show:Se.value,"conversation-id":l.value.id,"user-name":l.value.userName,"user-id":l.value.userId,onClose:p[12]||(p[12]=_=>{Se.value=!1,l.value=null}),onReported:qe},null,8,["show","conversation-id","user-name","user-id"])):d("",!0),a.value&&l.value?(s(),ee(Hs,{key:2,"user-id":l.value.userId,"user-name":l.value.userName,onClose:p[13]||(p[13]=_=>{a.value=!1,l.value=null}),onBlocked:le},null,8,["user-id","user-name"])):d("",!0)]))])}}}),Iu=Pe({__name:"messages",setup(K){const{isMobile:v}=hn();return(b,j)=>t(v)?(s(),ee(xu,{key:0})):(s(),ee(qc,{key:1}))}});export{Iu as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.