import{_ as B,a as C,b as I,c as L}from"./BfPjfeWt.js";import{_ as R}from"./DxB0DKYp.js";import{u as V}from"./BZ7f31ti.js";import{u as F,G as S,p as g,c as e,b as u,a,e as t,t as r,i as l,F as j,r as H,o,w as U,d as E,m as f}from"./BKiFavna.js";import{u as k}from"./BYRNlgE9.js";import{u as G}from"./BOqT4ZDK.js";import{_ as P}from"./DlAUqK2U.js";import"./DKzHUNYh.js";const q={"data-theme":"light"},z={id:"main-content",role:"main"},J={class:"author-wrap"},K={key:0,class:"author-profile"},M={class:"author-head"},O={class:"author-avatar"},Q=["src","alt"],W={key:1,class:"initial"},X={class:"author-info"},Y={class:"designation"},Z={key:0,class:"bio"},tt={class:"socials"},st=["href"],at=["href"],et=["href"],ot=["href"],nt=["href"],it=["href"],rt={class:"posts-heading"},_t={class:"posts-grid"},lt={class:"card-thumb"},ct=["src","alt"],dt={key:1,class:"card-emoji"},ut={class:"card-body"},ht={class:"card-category"},mt={class:"card-title"},ft={class:"card-meta"},bt={key:0,class:"no-posts"},pt={key:1,class:"loading"},gt={__name:"[id]",async setup(kt){let _,h;const{lang:d}=F(),{api:b}=V(),y=S(),c=f(()=>y.params.id),{data:v}=([_,h]=g(()=>k(()=>`author-${c.value}`,()=>b.get(`/authors/${c.value}`).catch(()=>({data:{}})),{watch:[c]})),_=await _,h(),_),{data:w}=([_,h]=g(()=>k(()=>`author-posts-${c.value}`,()=>b.get("/posts",{author:c.value,limit:12}).catch(()=>({data:{posts:[]}})),{watch:[c]})),_=await _,h(),_),s=f(()=>v.value?.data?.author||null),p=f(()=>w.value?.data?.posts||[]),x=m=>m?new Date(m).toLocaleDateString(d.value==="bn"?"bn-BD":"en-US",{year:"numeric",month:"short",day:"numeric"}):"";return G(()=>({title:s.value?s.value.name:"Author"})),(m,n)=>{const N=B,$=C,A=I,D=R,T=L;return o(),e("div",q,[u(N),u($),u(A),a("main",z,[a("div",J,[t(s)?(o(),e("div",K,[a("div",M,[a("div",O,[t(s).avatar?(o(),e("img",{key:0,src:t(s).avatar,alt:t(s).name},null,8,Q)):(o(),e("div",W,r((t(s).name||"?").charAt(0)),1))]),a("div",X,[a("h1",null,r(t(s).name),1),a("div",Y,r(t(s).designation),1),t(s).bio?(o(),e("p",Z,r(t(s).bio),1)):l("",!0),a("div",tt,[t(s).facebook?(o(),e("a",{key:0,href:t(s).facebook,target:"_blank"},[...n[0]||(n[0]=[a("i",{class:"fab fa-facebook"},null,-1)])],8,st)):l("",!0),t(s).twitter?(o(),e("a",{key:1,href:t(s).twitter,target:"_blank"},[...n[1]||(n[1]=[a("i",{class:"fab fa-twitter"},null,-1)])],8,at)):l("",!0),t(s).linkedin?(o(),e("a",{key:2,href:t(s).linkedin,target:"_blank"},[...n[2]||(n[2]=[a("i",{class:"fab fa-linkedin"},null,-1)])],8,et)):l("",!0),t(s).instagram?(o(),e("a",{key:3,href:t(s).instagram,target:"_blank"},[...n[3]||(n[3]=[a("i",{class:"fab fa-instagram"},null,-1)])],8,ot)):l("",!0),t(s).youtube?(o(),e("a",{key:4,href:t(s).youtube,target:"_blank"},[...n[4]||(n[4]=[a("i",{class:"fab fa-youtube"},null,-1)])],8,nt)):l("",!0),t(s).website?(o(),e("a",{key:5,href:t(s).website,target:"_blank"},[...n[5]||(n[5]=[a("i",{class:"fas fa-globe"},null,-1)])],8,it)):l("",!0)])])]),a("h2",rt,r(t(d)==="bn"?"লেখকের পোস্ট":"Posts by Author"),1),a("div",_t,[(o(!0),e(j,null,H(t(p),i=>(o(),e("article",{key:i.id,class:"news-card"},[u(D,{to:`/news/${encodeURIComponent(i.slug_bn)}`,class:"news-card-link"},{default:U(()=>[a("div",lt,[i.featured_image?(o(),e("img",{key:0,src:i.featured_image,alt:i.title_bn},null,8,ct)):(o(),e("span",dt,r(i.emoji||"📰"),1))]),a("div",ut,[a("div",ht,r(t(d)==="bn"?i.category_name_bn:i.category_name_en),1),a("h3",mt,r(t(d)==="bn"?i.title_bn:i.title_en||i.title_bn),1),a("div",ft,[n[6]||(n[6]=a("i",{class:"far fa-clock"},null,-1)),E(" "+r(x(i.published_at)),1)])])]),_:2},1032,["to"])]))),128)),t(p).length?l("",!0):(o(),e("p",bt,r(t(d)==="bn"?"এই লেখকের এখনো কোনো পোস্ট নেই":"No posts by this author yet"),1))])])):(o(),e("div",pt,[...n[7]||(n[7]=[a("p",null,"Loading...",-1)])]))])]),u(T)])}}},Tt=P(gt,[["__scopeId","data-v-db354ad4"]]);export{Tt as default};
