1import{_ as E}from"./CKu6o679.js";import{_ as L}from"./BBFculYg.js";import{_ as N}from"./SbgH_t8g.js";import{_ as P,u as O}from"./D8V_3mpE.js";import{_ as G,u as S}from"./DwdV2Rlz.js";import{_ as H,u as W}from"./fJH_zm6f.js";import{ak as z,u as J,x as K,k as p,v as X,w as Y,G as q,o as m,e as w,i,t as k,f as Z,b as r,F as Q,y as ee,c as f,T as te,d as ae,R as oe,h as x}from"./CnnHI4eV.js";import{b as se,$ as re}from"./C_LtU1BF.js";import"./DgZ9kXkY.js";import"./ut1Y4EHe.js";import"./BXY6pDJe.js";import"./Br9OsYz6.js";import"./BnmJMHbg.js";import"./CpWmnYms.js";const ne={class:"page-mucemtheque-media"},ce={class:"page-mucemtheque-media__header wrapper is-grid"},me={class:"h1--m"},ue={class:"h3"},le={class:"page-mucemtheque-media__list wrapper"},_=12,xe={__name:"TemplateMucemthequeMedia",props:{data:Object},async setup(C){var j;let u,v;const M=z(),n=J(),{formatPushVideo:b}=S(),{formatPushPodcast:A}=O(),{formatPushLecture:R}=W(),s=C;K({bodyAttrs:{class:"theme__dark"}});const V=()=>{switch(s.data.meta.media_type){case"video":return"wp-json/wpnuxt/v1/posts/video";case"podcast":return"wp-json/wpnuxt/v1/posts/podcast";case"lecture":return"wp-json/wpnuxt/v1/posts/lecture"}},d=p(null),l=p(+n.query.page||1),$=V(),c=p(Array(_)),y=p({major_theme:(j=n.query)!=null&&j.major_theme?decodeURIComponent(n.query.major_theme):null}),g=X(()=>c.value?Math.ceil((d.value||0)/_):null),F=([u,v]=Y(()=>se("wp-json/wpnuxt/v1/terms/major_theme",{query:{"cache-ttl":1*3600,hide_empty:!0,post_type:s.data.meta.media_type}})),u=await u,v(),u),U=async(e,a=1)=>{window.scrollTo({top:0,behavior:"smooth"}),c.value=Array(_);try{const t=await re($,{query:{perPage:_,page:a,"cache-ttl":3600,library_only:!0,...e}});c.value=((t==null?void 0:t.list)||[]).map(h=>I(h)),l.value=+(t==null?void 0:t.page)||1,d.value=+(t==null?void 0:t.total)||0}catch(t){console.error("[MucemthequeMedia] fetchMedias failed",t),c.value=[],d.value=0}},B=e=>{switch(e){case"podcast":return P;case"video":return G;case"lecture":return H;default:return P}},I=e=>{switch(s.data.meta.media_type){case"podcast":return A(e);case"video":return b(e);case"lecture":return R(e);default:return e}};return q(y,e=>{const a={...e.major_theme&&{major_theme:encodeURIComponent(e.major_theme)}};M.push({path:n.path,query:{...a,page:1}})},{deep:!0}),q(()=>n.query,e=>{const a={major_theme:e!=null&&e.major_theme?decodeURIComponent(e.major_theme):null};U(a,+e.page)},{immediate:!0}),(e,a)=>{const t=E,h=L,T=N;return m(),w("div",ne,[i("section",ce,[i("h1",me,k(s.data.post_title),1),i("p",ue,k(s.data.meta.header),1)]),Z(t,{class:"page-mucemtheque-media__filter",theme:"light",items:r(F).data.value.list,"have-all-button":!0,single:"",onOnClick:a[0]||(a[0]=o=>r(y).major_theme=o.term_id)},null,8,["items"]),i("div",le,[(m(!0),w(Q,null,ee(r(c),(o,D)=>(m(),f(ae(B(s.data.meta.media_type)),te({key:(o==null?void 0:o.ID)||D,ref_for:!0},o,{skeleton:!o}),null,16,["skeleton"]))),128))]),r(g)>1?(m(),f(h,{key:0,modelValue:r(l),"onUpdate:modelValue":a[1]||(a[1]=o=>oe(l)?l.value=o:null),"page-count":r(g)},null,8,["modelValue","page-count"])):x("",!0),s.data.meta.content?(m(),f(T,{key:1,data:s.data.meta.content},null,8,["data"])):x("",!0)])}}};export{xe 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.