import{b as d,d as C,_ as B,ax as z,aA as H,$ as k,X as N}from"./app-QjDgb7aF.js";import{X as V}from"./MkTimeline-BHgihgS6.js";import{b as M,a as b,j as l,p as a,F as _,D as g,u as n,H as u,q as t,x as $,w as D,f as y,E as f,g as w,i as m,k as p,I as E,t as R}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";import"./MkNotes-DrVlMmnc.js";import"./MkNote-RPFbRjy2.js";import"./MkReactionsViewer-D75lmVQ0.js";import"./MkReactionIcon.vue_vue_type_script_setup_true_lang-D23mNn1N.js";import"./share-available-Drgr3YiT.js";import"./get-note-summary-DlGmePWF.js";import"./MkDateSeparatedList.vue_vue_type_style_index_0_lang-87CjANkN.js";import"./MkPagination-DzUgufpZ.js";const T=["disabled"],U={key:0},j={key:0},q={key:0},O=M({__name:"MkChannelFollowButton",props:{channel:{},full:{type:Boolean,default:!1}},setup(o){const h=o,i=b(h.channel.isFollowing),e=b(!1);async function s(){e.value=!0;try{i.value?(await C("channels/unfollow",{channelId:h.channel.id}),i.value=!1):(await C("channels/follow",{channelId:h.channel.id}),i.value=!0)}catch(v){console.error(v)}finally{e.value=!1}}return(v,c)=>(l(),a("button",{class:$(["hdcaacmi _button",{wait:e.value,active:i.value,full:o.full}]),disabled:e.value,onClick:s},[e.value?(l(),a(_,{key:1},[o.full?(l(),a("span",q,g(n(d).ts.processing),1)):u("",!0),c[2]||(c[2]=t("i",{class:"ph-circle-notch ph-bold ph-lg fa-pulse ph-fw ph-lg"},null,-1))],64)):(l(),a(_,{key:0},[i.value?(l(),a(_,{key:0},[o.full?(l(),a("span",U,g(n(d).ts.unfollow),1)):u("",!0),c[0]||(c[0]=t("i",{class:"ph-minus ph-bold ph-lg"},null,-1))],64)):(l(),a(_,{key:1},[o.full?(l(),a("span",j,g(n(d).ts.follow),1)):u("",!0),c[1]||(c[1]=t("i",{class:"ph-plus ph-bold ph-lg"},null,-1))],64))],64))],10,T))}}),G=B(O,[["__scopeId","data-v-09271035"]]),J={key:0},K={key:0,class:"ph-caret-up ph-bold ph-lg"},L={key:1,class:"ph-caret-down ph-bold ph-lg"},Q={key:0,class:"hideOverlay"},W={class:"status"},Y={key:1,class:"description"},Z=M({__name:"channel",props:{channelId:{}},setup(o){const h=z(),i=o;let e=b(null),s=b(!0);D(()=>i.channelId,async()=>{e.value=await C("channels/show",{channelId:i.channelId})},{immediate:!0});function v(){h.push(`/channels/${e.value?.id}/edit`)}const c=y(()=>[...e.value&&e.value?.userId===k?.id?[{icon:"ph-gear-six ph-bold ph-lg",text:d.ts.edit,handler:v}]:[]]),F=y(()=>[]);return H(y(()=>e.value?{title:e.value.name,icon:"ph-television ph-bold ph-lg"}:null)),(I,r)=>{const S=f("MkPageHeader"),x=f("I18n"),X=f("Mfm"),A=f("MkSpacer"),P=f("MkStickyContainer");return l(),w(P,null,{header:m(()=>[p(S,{actions:c.value,tabs:F.value,"display-back-button":!0},null,8,["actions","tabs"])]),default:m(()=>[p(A,{"content-max":700},{default:m(()=>[n(e)?(l(),a("div",J,[t("div",{class:$(["wpgynlbz _panel _gap",{hide:!n(s)}])},[p(G,{channel:n(e),full:!0,class:"subscribe"},null,8,["channel"]),t("button",{class:"_button toggle",onClick:r[0]||(r[0]=()=>E(s)?s.value=!n(s):s=!n(s))},[n(s)?(l(),a("i",K)):(l(),a("i",L))]),n(s)?u("",!0):(l(),a("div",Q)),t("div",{style:R({backgroundImage:n(e).bannerUrl?`url(${n(e).bannerUrl})`:null}),class:"banner"},[t("div",W,[t("div",null,[r[1]||(r[1]=t("i",{class:"ph-users ph-bold ph-lg ph-fw ph-lg"},null,-1)),p(x,{src:n(d).ts._channel.usersCount,tag:"span",style:{"margin-left":"4px"}},{n:m(()=>[t("b",null,g(n(e).usersCount),1)]),_:1},8,["src"])]),t("div",null,[r[2]||(r[2]=t("i",{class:"ph-pencil ph-bold ph-lg ph-fw ph-lg"},null,-1)),p(x,{src:n(d).ts._channel.notesCount,tag:"span",style:{"margin-left":"4px"}},{n:m(()=>[t("b",null,g(n(e).notesCount),1)]),_:1},8,["src"])])]),r[3]||(r[3]=t("div",{class:"fade"},null,-1))],4),n(e).description?(l(),a("div",Y,[p(X,{text:n(e).description,"is-note":!1,i:n(k)},null,8,["text","i"])])):u("",!0)],2),n(k)?(l(),w(N,{key:0,channel:n(e),class:"post-form _panel _gap",fixed:""},null,8,["channel"])):u("",!0),(l(),w(V,{key:o.channelId,class:"_gap",src:"channel",channel:o.channelId,onBefore:I.before,onAfter:I.after},null,8,["channel","onBefore","onAfter"]))])):u("",!0)]),_:1})]),_:1})}}}),he=B(Z,[["__scopeId","data-v-c98e84fc"]]);export{he as default};
//# sourceMappingURL=channel-wHhp3nnY.js.map
