1import{_ as P}from"./DZgUIUW8.js";import{_ as T}from"./CR-c6KMq.js";import O from"./BTj_ovi6.js";import{_ as U}from"./D6rSYQOw.js";import{_ as j}from"./CR_F10Jj.js";import{_ as H}from"./Dbts3uYJ.js";import{u as M}from"./B97rRcSI.js";import{a4 as z,ap as G,V as X,F as Y,aU as J,w as x,a5 as Q,av as r,aG as p,a9 as f,aC as i,aX as W,as as e,aD as R,aw as b,ax as F,aE as S,aT as v,ae as Z,aN as K,r as q,c as V,n as ee}from"./DvueK4DZ.js";import{a as te}from"./FmuzJG-g.js";import"./BQHNewu7.js";import"./BPOF-luG.js";const se={class:"flex flex-col gap-10"},oe={class:"container mx-auto pb-12 flex flex-col"},ae={class:"flex items-center gap-5 flex-col md:flex-row mb-10"},ne={class:"relative w-full items-center"},re={class:"absolute start-0 inset-y-0 flex items-center justify-center px-5"},le={key:0,class:"flex items-center justify-between gap-5 flex-col md:flex-row mb-10"},ie={class:"flex items-center gap-2"},ce={class:"text-white font-medium text-xl md:text-[32px]"},ue={key:1,class:"flex flex-col gap-5"},de={key:2,class:"flex flex-col gap-5"},pe={key:3,class:"flex flex-col items-center justify-center py-12 text-center"},me={class:"text-sm text-gray-400"},fe=105,Re=z({__name:"index",setup(_e){M({title:"Press Releases",description:"Official press releases from ASIFA-Hollywood, the International Animated Film Society."});const l=G(),h=X(),s=q(""),u=q(3),a=q([]),{apiBase:B}=Y().public,{data:C,status:g,refresh:d}=J("press-releases",()=>$fetch("/press",{baseURL:B,query:{keyword:s.value,per_page:u.value,category_id:11,publish_in_asifa:1}}),{lazy:!0,immediate:!1}),I=te(()=>{a.value=[],d()},500);x(s,t=>{h.push({query:{...l.query,keyword:t||void 0,page:void 0}}),(!t||t.length>=3)&&I()},{immediate:!1});const m=V(()=>!!s.value);x(m,t=>{u.value=t?1e3:3,t&&(a.value=[],d())}),Q(()=>{l.query.keyword&&(s.value=l.query.keyword),u.value=m.value?1e3:3,d()});const _=V(()=>g.value==="pending");function L(){_.value||(u.value+=3,h.push({query:{...l.query,page:void 0,per_page:void 0}}),d())}x(C,async t=>{if(t?.data.data){const n=t.data.data.map(c=>({...c,photo_url:c.photo_url})),w=a.value.length;if(a.value=n,u.value>3){await ee();const c=document.querySelector(`[data-item-index="${w}"]`);if(c){const y=c.getBoundingClientRect().top+window.pageYOffset-fe-20;window.scrollTo({top:y,behavior:"smooth"})}}}});function N(t){return t?decodeURIComponent(t):""}async function A(){s.value="",u.value=3,await h.replace({query:{}}),await d()}return x(()=>[l.query.month,l.query.year],()=>{l.query.month&&l.query.year&&(a.value=[],d())},{immediate:!0}),(t,n)=>{const w=P,c=T,k=O,y=U,D=j,$=H;return r(),p("div",se,[f(w),i("div",oe,[i("div",ae,[i("div",ne,[f(c,{id:"search",modelValue:e(s),"onUpdate:modelValue":n[0]||(n[0]=o=>W(s)?s.value=o:null),type:"text",placeholder:"Search for press release",class:"pl-14"},null,8,["modelValue"]),i("span",re,[f(k,{name:"icon:search",class:"h-5 w-5 text-gray-300"})])])]),e(m)?(r(),p("div",le,[i("div",ie,[i("h1",ce," Search results for: "+R(e(s)?`"${e(s)}"`:""),1)]),e(m)?(r(),b(y,{key:0,variant:"outline",class:"w-full md:w-auto",onClick:A},{default:F(()=>[...n[1]||(n[1]=[S(" Clear Filters ",-1)])]),_:1})):v("",!0)])):v("",!0),e(_)?(r(),p("div",ue,[f(D,{count:3})])):e(g)==="success"&&e(a).length>0?(r(),p("div",de,[(r(!0),p(Z,null,K(e(a),(o,E)=>(r(),b($,{id:o.id,key:o.id,"data-item-index":E,photo:o.photo,created:o.created,title:N(o.title),intro:N(o.intro),slug:o.slug,repositories:o.repositories,"is-legacy-post":o.is_legacy_post,type:"press-releases",variant:"two"},null,8,["id","data-item-index","photo","created","title","intro","slug","repositories","is-legacy-post"]))),128))])):e(g)==="success"&&e(a).length===0?(r(),p("div",pe,[f(k,{name:"icon:search",class:"h-12 w-12 text-gray-300 mb-4"}),n[2]||(n[2]=i("p",{class:"text-lg text-gray-600 mb-2"}," No news found ",-1)),i("p",me,R(e(s)?`No results found for "${e(s)}"`:"No news articles available"),1)])):v("",!0),e(a).length>0&&e(a).length<(e(C)?.data.total??0)&&!e(m)?(r(),b(y,{key:4,class:"mt-8 self-center",variant:"outline",loading:e(_),disabled:e(_),onClick:L},{default:F(()=>[...n[3]||(n[3]=[S(" Load More ",-1)])]),_:1},8,["loading","disabled"])):v("",!0)])])}}});
1export{Re 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.