PageSourceSearch

https://www.calvary.my/_nuxt/GuF-0x_z.js

js calvary.my collected 2026-10-10 01:50:58 UTC 9,284 bytes, 1 lines download raw bytes

1import{d as T}from"./DIq6kwtF.js";import{k as P,ar as B,ak as I,o as u,d as f,e as l,f as b,g as o,v as x,t as V,y as U,bt as J,D as L,i as m,h as j,j as z,A as _,ai as D,bd as K,ap as M,an as q,F as O,C as E,q as C}from"#entry";import{_ as H}from"./BTmZTOKx.js";import{_ as Y}from"./CsK7jnA6.js";import{_ as R}from"./Bb0qXpeH.js";import{_ as G}from"./CBRDAZBE.js";import"./Wke7moiz.js";const Q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(n){if(!n)return null;const a=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(a)return{year:Number(a[1]),month:Number(a[2])-1,day:Number(a[3])};const r=new Date(n);return isNaN(r)?null:{year:r.getFullYear(),month:r.getMonth(),day:r.getDate()}}function W(n){const a=k(n);return a?`${Q[a.month]} ${a.year}`:n||""}const X={key:0,class:"flex flex-col gap-0.5 min-w-0 col-span-2 lg:col-span-1"},Z={key:2,class:"flex flex-col gap-0.5 min-w-0"},ee={key:3,class:"flex flex-col gap-0.5 min-w-0 col-span-2 lg:col-span-1"},te={class:"bg-white rounded-full px-3 py-3 flex items-center gap-2"},le={__name:"SearchBanner",props:{articles:{type:Array,default:()=>[]},initialFilters:{type:Object,default:()=>({})},fields:{type:Array,default:()=>["ministry","year","month","keyword"]}},emits:["search"],setup(n,{emit:a}){const r=n,w=a,p=e=>r.fields.includes(e),y=m(()=>r.fields.length===1&&r.fields[0]==="year"),v=m(()=>y.value?"flex flex-col sm:flex-row sm:items-end sm:w-fit":"grid grid-cols-2 lg:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)_minmax(0,1fr)_minmax(0,2fr)_max-content] items-end"),i=B({ministry:r.initialFilters.ministry??"",year:r.initialFilters.year??"",month:r.initialFilters.month??"",keyword:r.initialFilters.keyword??""});I(()=>{(i.ministry||i.year||i.month!==""||i.keyword)&&w("search",i)});const S=m(()=>{const e=new Set;for(const t of r.articles)for(const c of t.categories||[])e.add(c);return[...e].sort()}),$=m(()=>{const e=new Set;for(const t of r.articles){const c=k(t.date);c&&e.add(c.year)}return[...e].sort((t,c)=>c-t)}),N=[{value:"0",label:"January"},{value:"1",label:"February"},{value:"2",label:"March"},{value:"3",label:"April"},{value:"4",label:"May"},{value:"5",label:"June"},{value:"6",label:"July"},{value:"7",label:"August"},{value:"8",label:"September"},{value:"9",label:"October"},{value:"10",label:"November"},{value:"11",label:"December"}],A=m(()=>[{label:"All",value:""},...S.value.map(e=>({label:e,value:e}))]),h=m(()=>[{label:"All",value:""},...$.value.map(e=>({label:String(e),value:e}))]),s=m(()=>[{label:"All",value:""},...N]);return(e,t)=>{const c=T;return u(),f("div",{class:V(["bg-[#eff4fe] border border-[#cad6fb] rounded-[30px] p-4 sm:p-5 gap-3 sm:gap-4 lg:gap-5",o(v)])},[p("ministry")?(u(),f("div",X,[t[6]||(t[6]=l("div",{class:"py-2"},[l("span",{class:"font-semibold text-[#1e1e48] text-xl leading-none"},"Topic")],-1)),b(c,{modelValue:o(i).ministry,"onUpdate:modelValue":t[0]||(t[0]=d=>o(i).ministry=d),options:o(A),"option-label":"label","option-value":"value",placeholder:"All",class:"news-select w-full"},null,8,["modelValue","options"])])):x("",!0),p("year")?(u(),f("div",{key:1,class:V(["flex flex-col gap-0.5 min-w-0",{"sm:w-44":o(y)}])},[t[7]||(t[7]=l("div",{class:"py-2"},[l("span",{class:"font-semibold text-[#1e1e48] text-xl leading-none"},"Year")],-1)),b(c,{modelValue:o(i).year,"onUpdate:modelValue":t[1]||(t[1]=d=>o(i).year=d),options:o(h),"option-label":"label","option-value":"value",placeholder:"All",class:"news-select w-full"},null,8,["modelValue","options"])],2)):x("",!0),p("month")?(u(),f("div",Z,[t[8]||(t[8]=l("div",{class:"py-2"},[l("span",{class:"font-semibold text-[#1e1e48] text-xl leading-none"},"Month")],-1)),b(c,{modelValue:o(i).month,"onUpdate:modelValue":t[2]||(t[2]=d=>o(i).month=d),options:o(s),"option-label":"label","option-value":"value",placeholder:"All",class:"news-select w-full"},null,8,["modelValue","options"])])):x("",!0),p("keyword")?(u(),f("div",ee,[t[10]||(t[10]=l("div",{class:"py-2"},[l("span",{class:"font-semibold text-[#1e1e48] text-xl leading-none"},"Search Keyword")],-1)),l("div",te,[t[9]||(t[9]=l("span",{class:"pi pi-search text-[#1e1e48] shrink-0",style:{"font-size":"0.875rem"}},null,-1)),U(l("input",{"onUpdate:modelValue":t[3]||(t[3]=d=>o(i).keyword=d),type:"text",placeholder:"Search by keyword",class:"flex-1 min-w-0 font-normal text-[#1e1e48] text-base leading-[1.5] bg-transparent border-none outline-none placeholder:text-[#1e1e48]",onKeyup:t[4]||(t[4]=L(d=>e.$emit("search",o(i)),["enter"]))},null,544),[[J,o(i).keyword]])])])):x("",!0),l("button",{class:V(["col-span-2 lg:col-span-1 w-full lg:w-auto px-5 py-3 rounded-full font-semibold text-white text-sm tracking-[0.7px] uppercase shadow-[0px_6px_15px_-6px_rgba(30,30,30,0.06)] transition-opacity hover:opacity-90 whitespace-nowrap",{"sm:w-auto":o(y)}]),style:{"background-image":"linear-gradient(74deg, #383889 5%, #da2435 94%)"},onClick:t[5]||(t[5]=d=>e.$emit("search",o(i)))}," Search ",2)],2)}}},ne=P(le,[["__scopeId","data-v-33271ecd"]]),ae={class:"bg-white border border-[#cad6fb] rounded-[20px] p-4 flex flex-col gap-6 h-full"},se={class:"w-full overflow-hidden rounded-[12px] aspect-[10/13]"},oe={class:"flex flex-col gap-2 flex-1"},re={class:"font-semibold text-[#1e1e48] text-xl leading-tight m-0 line-clamp-2"},ie={class:"font-normal text-[#1e1e48] text-base leading-[1.5] line-clamp-3 m-0"},ce=["href"],de={__name:"NewsletterCard",props:{newsletter:{type:Object,required:!0}},setup(n){const a=n,r=m(()=>a.newsletter.pdf_url||a.newsletter.pdfUrl||"");return(w,p)=>{const y=H,v=Y;return u(),f("div",ae,[l("div",se,[b(y,{src:n.newsletter.image,alt:n.newsletter.title,class:"w-full h-full object-cover"}
1,null,8,["src","alt"])]),l("div",oe,[b(v,{class:"self-start"},{default:j(()=>[z(_(o(W)(n.newsletter.date)),1)]),_:1}),l("h3",re,_(n.newsletter.title),1),l("p",ie,_(n.newsletter.description||n.newsletter.excerpt),1)]),o(r)&&o(r)!=="#"?(u(),f("a",{key:0,href:o(r),target:"_blank",rel:"noopener noreferrer",class:"btn-gradient-underline inline-flex flex-col"},[...p[0]||(p[0]=[l("span",{class:"inline-flex items-center gap-2"},[l("span",{class:"pi pi-download btn-underline-icon",style:{"font-size":"1rem"},"aria-hidden":"true"}),l("span",{class:"btn-underline-text"},"Download PDF")],-1),l("span",{class:"btn-underline-line","aria-hidden":"true"},null,-1)])],8,ce)):x("",!0)])}}},ue={class:"container"},pe={class:"relative z-10 flex flex-col gap-[60px] items-center"},me={class:"flex flex-col gap-10 items-center text-center"},fe={key:0,class:"font-semibold text-white text-[clamp(1.75rem,4vw,3rem)] leading-none m-0"},ye=["innerHTML"],ge={class:"flex flex-col gap-10 w-full"},xe={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-[30px]"},$e={__name:"MoreSection",props:{title:{type:String,default:""},description:{type:String,default:""},articles:{type:Array,default:()=>[]},backgroundImage:{type:String,default:""},perPage:{type:Number,default:12},initialFilters:{type:Object,default:()=>({})},cardType:{type:String,default:"article"}},setup(n){const a=n,r=m(()=>a.cardType==="newsletter"?["year"]:["ministry","year","month","keyword"]);function w(s,e){return s.filter(t=>{if(e.ministry&&!(t.categories||[]).includes(e.ministry))return!1;const c=k(t.date);if(e.year&&(!c||c.year!==e.year)||e.month!==""&&e.month!=null&&(!c||c.month!==parseInt(e.month)))return!1;if(e.keyword){const d=e.keyword.toLowerCase(),F=(t.title||"").toLowerCase(),g=(t.excerpt||t.description||"").toLowerCase();if(!F.includes(d)&&!g.includes(d))return!1}return!0})}const p=D(1),y=D(w(a.articles,a.initialFilters)),v=s=>{const e=k(s.date);return e?e.year*1e4+(e.month+1)*100+e.day:0},i=m(()=>[...y.value].sort((s,e)=>v(e)-v(s))),S=m(()=>Math.ceil(i.value.length/a.perPage)),$=m(()=>{const s=(p.value-1)*a.perPage;return i.value.slice(s,s+a.perPage)}),N=K();function A(s){p.value=1;const e={};s.ministry&&(e.ministry=s.ministry),s.year&&(e.year=String(s.year)),s.month!==""&&s.month!=null&&(e.month=String(s.month)),s.keyword&&(e.keyword=s.keyword),N.replace({query:e}),y.value=w(a.articles,s)}M(()=>a.articles,s=>{y.value=w(s,a.initialFilters)});const h=D(null);return M(p,()=>{h.value?.scrollIntoView({behavior:"smooth",block:"start"})}),(s,e)=>{const t=ne,c=de,d=R,F=G;return u(),f("section",{ref_key:"sectionEl",ref:h,class:"relative py-20 overflow-hidden"},[l("div",ue,[l("div",{class:"absolute inset-0 bg-cover bg-center bg-no-repeat",style:q({backgroundImage:`url('${n.backgroundImage}')`})},null,4),e[2]||(e[2]=l("div",{class:"absolute inset-0 bg-black/50"},null,-1)),l("div",pe,[l("div",me,[e[1]||(e[1]=l("div",{class:"w-0 h-20 border-l-2 border-[#da2435]"},null,-1)),n.title?(u(),f("h2",fe,_(n.title),1)):x("",!0),n.description?(u(),f("div",{key:1,class:"drupal-content text-white/90 max-w-2xl",innerHTML:n.description},null,8,ye)):x("",!0)]),l("div",ge,[b(t,{articles:a.articles,"initial-filters":n.initialFilters,fields:o(r),onSearch:A},null,8,["articles","initial-filters","fields"]),l("div",xe,[(u(!0),f(O,null,E(o($),g=>(u(),f(O,{key:g.id},[n.cardType==="newsletter"?(u(),C(c,{key:0,newsletter:g},null,8,["newsletter"])):(u(),C(d,{key:1,article:g},null,8,["article"]))],64))),128))]),b(F,{"current-page":o(p),"total-pages":o(S),"onUpdate:page":e[0]||(e[0]=g=>p.value=g)},null,8,["current-page","total-pages"])])])])],512)}}};export{$e 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.