PageSourceSearch

https://platform.life/_nuxt/NBMWN3Dp.js

js platform.life collected 2026-10-06 13:01:06 UTC 7,977 bytes, 1 lines download raw bytes

1import{u as q,_ as Y}from"./TrHgYepr.js";import{_ as V,b as u,o as i,a as e,n as w,d as m,F as E,r as H,t as R,g as S,j as f,k as h,h as Z,l as tt,i as et,c as O,u as r,m as D,w as lt,p as at,e as P,q as I}from"./BpAW9DpV.js";import{_ as st}from"./BCBp6GQC.js";import{_ as rt}from"./C34ULWpT.js";const it={name:"IconFilter"},nt={xmlns:"http://www.w3.org/2000/svg",width:"13",height:"10",viewBox:"0 0 13 10",fill:"none"};function ot(x,l,n,k,o,c){return i(),u("svg",nt,l[0]||(l[0]=[e("path",{d:"M0.875 1.25H12.125M2.75 5H10.25M5 8.75H8",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const ut=V(it,[["render",ot]]),ct={name:"CollectionFilters",props:{articlesTypeText:{type:String,default(){return"Article"}},totalArticles:{type:Number,default(){return 0}},type:{type:String,default(){return""}},filterOptions:{type:Array,default(){return[]}},selectedFilters:{type:Array,default(){return[]}}},emits:["updateFilters"],data(){return{overlayActive:!1}},methods:{updateFilters(x){this.$emit("updateFilters",x),this.overlayActive=!1},toggleOverlay(){this.overlayActive=!this.overlayActive}}},dt={class:"w-full flex justify-between items-center"},gt={key:0,class:"flex flex-wrap gap-2 mt-9"},pt=["aria-label","onClick"],bt={class:"button__container"},ft={class:"flex justify-between items-center"},_t={class:"flex justify-between items-start"},mt={class:"button__container gap-x-2"},yt={key:0,class:"heading-s mediumMax:hidden"};function vt(x,l,n,k,o,c){const _=ut;return i(),u("div",null,[e("div",{ref:"filtersOverlayBg",class:w(["fixed w-full h-screen right-0 top-0 bottom-0 transform bg-black opacity-60 z-40",[o.overlayActive?"translate-x-0":"translate-x-full"]]),onClick:l[0]||(l[0]=(...s)=>c.toggleOverlay&&c.toggleOverlay(...s))},null,2),e("div",{ref:"filtersOverlay",class:w(["fixed w-full h-screen right-0 bottom-0 px-8 pt-11 transform duration-300 transition-transform box-border bg-brand-primary z-50 largeMax:h-[60vh] large:w-[27.25rem] largeMax:text-text-light large:pt-20 large:px-14 large:top-0 large:rounded-tl-[1.25rem] large:rounded-bl-[1.25rem] large:bg-white",[o.overlayActive?"largeMax:translate-y-0 large:translate-x-0":"largeMax:translate-y-full large:translate-x-full"]])},[e("div",dt,[l[5]||(l[5]=e("h3",{class:"heading-m large:heading-s"}," Filter by: ",-1)),e("button",{type:"button",class:"relative w-4 h-4 block z-60","aria-label":"Close",onClick:l[1]||(l[1]=(...s)=>c.toggleOverlay&&c.toggleOverlay(...s))},l[4]||(l[4]=[e("span",{class:"absolute left-0 w-full h-px bg-white large:bg-black transform rotate-45 top-1/2"},null,-1),e("span",{class:"absolute bottom-0 left-0 w-full h-px bg-white large:bg-black transform -rotate-45 top-1/2"},null,-1)]))]),n.filterOptions.length?(i(),u("ul",gt,[e("li",null,[e("button",{class:w(["button button--filter",{"is-active":!n.selectedFilters.length}]),type:"button","aria-label":"Remove all filters","aria-controls":"blog-listing-results",onClick:l[2]||(l[2]=s=>c.updateFilters(null))},l[6]||(l[6]=[e("span",null,"All",-1)]),2)]),(i(!0),u(E,null,H(n.filterOptions,s=>{var y,p;return i(),u("li",{key:s.id},[(p=(y=s==null?void 0:s.attributes[n.type])==null?void 0:y.data)!=null&&p.length?(i(),u("button",{key:0,class:w([{"is-active":n.selectedFilters.includes(s.attributes.slug)},"button button--filter"]),type:"button","aria-label":`${n.selectedFilters.includes(s.attributes.slug)?"Remove":"Apply"} '${s.attributes.name}' filter.`,"aria-controls":"blog-listing-results",onClick:A=>c.updateFilters(s.attributes.slug)},[e("span",bt,R(s.attributes.name),1)],10,pt)):m("",!0)])}),128))])):m("",!0)],2),e("div",ft,[e("div",_t,[e("button",{type:"button",class:"button button--primary flex items-center cursor-pointer group",onClick:l[3]||(l[3]=(...s)=>c.toggleOverlay&&c.toggleOverlay(...s))},[e("div",mt,[S(_),l[7]||(l[7]=e("span",{class:"heading-xxs"}," Filter Articles ",-1))])])]),n.totalArticles&&n.articlesTypeText?(i(),u("div",yt,R(`${n.totalArticles} ${n.articlesTypeText}${n.totalArticles>1?"s":""}`),1)):m("",!0)])])}const ht=V(ct,[["render",vt]]),xt={class:"bg-background-one"},kt={class:"relative z-0 text-text-light bg-brand-primary pt-[8.75rem] large:pt-[8.7rem]"},wt={class:"container"},At={class:"relative"},Ft={class:"relative wrap medium:pr-[16.666%]"},Ct={class:"heading-xxl font-light pb-7 animate-fadeInUp delay-200"},$t={id:"blog-listing-results",class:"wrap pt-8 pb-16 large:pt-11 large:pb-28"},qt={key:0,class:"grid grid-cols-4 gap-y-[4.7rem] outline-none medium:grid-cols-12 medium:gap-x-11 medium:gap-y-[5.7rem]"},Ot={key:1,class:"wysiwyg"},Mt={__name:"index",async setup(x){var U;let l,n;const k=()=>{var t,a,g;return((g=(a=(t=h())==null?void 0:t.query)==null?void 0:a.category)==null?void 0:g.split(","))||[]},o=f(k()),c=()=>{var t,a;return((a=(t=h())==null?void 0:t.query)==null?void 0:a.sort)||"desc"},_=f(c()),s=f(6),y=()=>{var t,a;return Number((a=(t=h())==null?void 0:t.query)==null?void 0:a.page)||1},p=f(y()),A=f(!1),F=f(0),B=f(null),[{data:d},{data:M},{data:b,refresh:C}]=([l,n]=Z(()=>Promise.all([q("blog-listing",()=>$fetch("/blog-listing",{baseURL:P().public.adminApiUrl,query:{populate:["meta.og_share_image"]}}),{transform:t=>t.data}),q("filter-options",()=>$fetch("/categories",{baseURL:P().public.adminApiUrl,query:{populate:["blogs"]}}),{transform:t=>t.data}),q(h().fullPath,()=>$fetch("/blogs",{onRequest({options:t}){var a;t.query=t.query||{},(a=o.value)!=null&&a.length&&o.value.forEach((g,$)=>{t.query[`filters[categories][slug][$in][${$}]`]=g})},baseURL:P().public.adminApiUrl,query:{"pagination[pageSize]":s.value,"pagination[page]":p.value,sort:`published_date:${_.value}`,populate:["image","categories"]}}).finally(()=>{var t;(t=B.value)==null||t.focus(),A.value?F.value=F.value+1:A.value=!0}
1),"$ns2Xa_1kks")]).catch(t=>console.error(t))),l=await l,n(),l);tt(()=>{window.addEventListener("popstate",()=>{_.value=c(),o.value=k(),p.value=y(),C()})});function W(t){if(t){const a=o.value.findIndex(g=>g===t);a>-1?o.value.splice(a,1):o.value.push(t)}else o.value.splice(0,o.value.length);p.value=1,_.value="desc",I().push({query:{category:o.value.length?o.value.join(","):null}}).then(C())}function K(t,a){a.preventDefault(),p.value=t,I().push({query:{...h().query,page:t>1?t:null}}).then(C())}return(U=d==null?void 0:d.value)!=null&&U.attributes.meta&&et(d.value.attributes.meta,"Blog listing"),(t,a)=>{var L,N,z,T,j;const g=Y,$=ht,X=st,G=at,J=rt;return i(),u("div",null,[e("div",xt,[e("div",kt,[e("div",wt,[e("div",At,[e("div",Ft,[e("h1",Ct,R(r(d).attributes.title?r(d).attributes.title:"Blog"),1),r(d).attributes.text?(i(),O(g,{key:0,class:"body-l pb-7",data:{html:r(d).attributes.text}},null,8,["data"])):m("",!0)])])])]),e("div",{ref_key:"blogListing",ref:B,tabindex:"0"},[(L=r(b))!=null&&L.data.length&&r(M).length?(i(),O($,{key:0,class:"wrap mt-10","articles-type-text":"Article","total-articles":r(b).meta.pagination.total?r(b).meta.pagination.total:0,type:"blogs","filter-options":r(M),"selected-filters":r(o),"selected-sort":r(_),onUpdateFilters:W},null,8,["total-articles","filter-options","selected-filters","selected-sort"])):m("",!0),e("div",$t,[(z=(N=r(b))==null?void 0:N.data)!=null&&z.length?(i(),u("div",qt,[(i(!0),u(E,null,H(r(b).data,(v,Q)=>(i(),u("div",{key:Q,class:"col-span-4 medium:col-span-6 large:col-span-4"},[S(X,{href:`/blog/${v.attributes.slug}`,image:v.attributes.image,title:v.attributes.title,categories:v.attributes.categories,"published-date":v.attributes.published_date},null,8,["href","image","title","categories","published-date"])]))),128)),(i(),u("div",{key:`update-data-${r(F)}`,class:"sr-only","aria-live":"polite"}," Results updated. "))])):(i(),u("div",Ot,[a[1]||(a[1]=D(" No results. ")),S(G,{to:"/"},{default:lt(()=>a[0]||(a[0]=[D(" Return to the homepage ")])),_:1,__:[0]})]))]),(T=r(b))!=null&&T.meta.pagination?(i(),O(J,{key:1,class:"wrap pb-20 large:pb-[6.9rem]","page-meta":(j=r(b))==null?void 0:j.meta,onUpdatePage:K},null,8,["page-meta"])):m("",!0)],512)])])}}};export{Mt 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.