import{X}from"./MkNotes-Z5KXbZLG.js";import{B as i,i as d,a as e,an as q,F as z,$ as v,n as L}from"./app-JmgyQoR0.js";import{b as M,a as T,p as U,c as w,o as D,D as E,h as f,t as H,z as C,i as O,j as y,l as k,H as I,x as S,y as j,u as B,K as J,E as K,F as Q,I as W,J as Y}from"./vue-y3KLWBaS.js";const Z=u=>(W("data-v-612f8adf"),u=u(),Y(),u),ee=Z(()=>B("i",{class:"ph-arrow-up ph-bold"},null,-1)),ne=M({__name:"MkTimeline",props:{src:{},list:{},antenna:{},channel:{},sound:{type:Boolean}},emits:["note","queue"],setup(u,{emit:N}){const t=u;let R=T(0);const G=N;U("inChannel",w(()=>t.src==="channel"));const m=T(),a=s=>{var o;(o=m.value.pagingComponent)==null||o.prepend(s),G("note"),t.sound&&z(v&&s.userId===v.id?"noteMy":"note")},P=()=>{var s;(s=m.value.pagingComponent)==null||s.reload()},$=()=>{var s;(s=m.value.pagingComponent)==null||s.reload()},_=()=>{var s,o;(s=m.value.pagingComponent)!=null&&s.backed||(o=m.value.pagingComponent)==null||o.reload()};let l,r,n,h,c,p;if(t.src==="antenna")l="antennas/notes",r={antennaId:t.antenna},n=i.useChannel("antenna",{antennaId:t.antenna}),n.on("note",a),c=d.ts.antennaTimelineHint,p=e.state.tlAntennaHintClosed;else if(t.src==="home")l="notes/timeline",r={withReplies:e.state.showTimelineReplies},n=i.useChannel("homeTimeline",{withReplies:e.state.showTimelineReplies}),n.on("note",a),h=i.useChannel("main"),h.on("follow",_),h.on("unfollow",_),c=d.ts._tutorial.step5_3,p=e.state.tlHomeHintClosed;else if(t.src==="local")l="notes/local-timeline",r={withReplies:e.state.showTimelineReplies},n=i.useChannel("localTimeline",{withReplies:e.state.showTimelineReplies}),n.on("note",a),c=d.ts._tutorial.step5_4,p=e.state.tlLocalHintClosed;else if(t.src==="recommended")l="notes/recommended-timeline",r={withReplies:e.state.showTimelineReplies},n=i.useChannel("recommendedTimeline",{withReplies:e.state.showTimelineReplies}),n.on("note",a),c=d.ts._tutorial.step5_6,p=e.state.tlRecommendedHintClosed;else if(t.src==="social")l="notes/hybrid-timeline",r={withReplies:e.state.showTimelineReplies},n=i.useChannel("hybridTimeline",{withReplies:e.state.showTimelineReplies}),n.on("note",a),c=d.ts._tutorial.step5_5,p=e.state.tlSocialHintClosed;else if(t.src==="global")l="notes/global-timeline",r={withReplies:e.state.showTimelineReplies},n=i.useChannel("globalTimeline",{withReplies:e.state.showTimelineReplies}),n.on("note",a),c=d.ts._tutorial.step5_7,p=e.state.tlGlobalHintClosed;else if(t.src==="mentions")l="notes/mentions",n=i.useChannel("main"),n.on("mention",a);else if(t.src==="directs"){l="notes/mentions",r={visibility:"specified"};const s=o=>{o.visibility==="specified"&&a(o)};n=i.useChannel("main"),n.on("mention",s)}else t.src==="list"?(l="notes/user-list-timeline",r={listId:t.list},n=i.useChannel("userList",{listId:t.list}),n.on("note",a),n.on("userAdded",P),n.on("userRemoved",$)):t.src==="channel"&&(l="channels/timeline",r={channelId:t.channel},n=i.useChannel("channel",{channelId:t.channel}),n.on("note",a));function x(){switch(t.src){case"home":e.set("tlHomeHintClosed",!0);break;case"local":e.set("tlLocalHintClosed",!0);break;case"recommended":e.set("tlRecommendedHintClosed",!0);break;case"social":e.set("tlSocialHintClosed",!0);break;case"global":e.set("tlGlobalHintClosed",!0);break;case"antenna":e.set("tlAntennaHintClosed",!0);break}}const A={endpoint:l,limit:10,params:r};D(()=>{n.dispose(),h&&h.dispose()});const F=w(e.makeGetterSetter("newPostsButton")),b=w(e.makeGetterSetter("newPostsGlowOpacity"));return(s,o)=>{const V=E("I18n");return f(),H(Q,null,[C(c)&&!C(p)?(f(),O(q,{key:0,closeable:!0,class:"_gap",onClose:x},{default:y(()=>[k(V,{src:C(c)},{icon:y(()=>[]),_:1},8,["src"])]),_:1})):I("",!0),R.value>0?(f(),H("div",{key:1,class:S(["new",{noShadow:b.value<.05}]),style:j({"--opacity":b.value})},[B("button",{class:S(["_buttonPrimary _shadow",{instant:!s.$store.state.animation,isHidden:!F.value}]),onClick:o[0]||(o[0]=g=>m.value.scrollTop())},[J(K(C(d).ts.newNoteRecived)+" ",1),ee],2)],6)):I("",!0),k(X,{ref_key:"tlComponent",ref:m,"no-gap":!s.$store.state.showGapBetweenNotesInTimeline,pagination:A,onQueue:o[1]||(o[1]=g=>R.value=g)},null,8,["no-gap"])],64)}}}),le=L(ne,[["__scopeId","data-v-612f8adf"]]);export{le as X};
