PageSourceSearch

https://fitlab-me.com/_nuxt/BoRE8auF.js

js fitlab-me.com collected 2026-10-01 11:57:14 UTC 6,569 bytes, 1 lines download raw bytes

1import{_ as Z}from"./oIsv4qHt.js";import{_ as K}from"./CBE-7-Rk.js";import{_ as W}from"./8DzIIoJ-.js";import{_ as tt}from"./B7Ov7EQ_.js";import{_ as et}from"./qvbF_c5d.js";import{J as at,p as S,e as st,T as nt,a1 as ot,c,a as s,F as L,x as I,f as p,g as y,b as C,A as $,r as d,X as it,B as b,a2 as lt,o as i,I as V,t as g,h as T,w as rt,D as N}from"./m6h8_Rrz.js";import{a as ct}from"./ClSZBVeb.js";import{u as ut}from"./K0svcCko.js";import"./BLDnKh19.js";import"./CYOy8010.js";import"./jaEWFyPk.js";import"./QsGfvOYf.js";const mt={class:"mt-10 sm:mt-16 pb-10 sm:pb-16"},pt={class:"mb-10 sm:mb-16 xl:mb-24 max-sm:px-4"},dt={class:"mb-8 sm:mb-10"},gt={class:"w-full overflow-x-auto overflow-y-hidden pr-3 pb-3 [scrollbar-gutter:stable] flex gap-2 sm:gap-3"},xt=["onClick"],ft={class:"grid grid-cols-1 lg:grid-cols-3 gap-8 lg:gap-10"},_t={class:"absolute bottom-0 p-5 sm:p-6 xl:p-7 text-white w-full"},ht={class:"flex items-center gap-3 mb-3 text-xs sm:text-sm"},vt={class:"text-white/85"},yt={key:0,class:"mb-2 text-xs sm:text-sm font-medium uppercase tracking-[0.18em] text-white/75"},bt=["title"],wt={class:"mt-3 text-sm sm:text-base text-white/90 line-clamp-2"},Bt={class:"mt-8 sm:mt-10 flex items-center justify-center","aria-live":"polite"},kt={key:0,class:"text-sm sm:text-base text-[#4B5563]"},Ct={key:1,class:"text-sm sm:text-base text-[#4B5563]"},Ft=9,zt={__name:"index",async setup(Pt){let l,_;const F=at(),r=d([]),n=it({category:"all",page:1}),u=d(1),h=d(1),v=d(!1),w=d(null),x=d(null),{data:U}=([l,_]=S(()=>$("/api/masters",{params:{type:"blog-category"}})),l=await l,_(),l),z=b(()=>U.value?.data?.results||[]),R=b(()=>[{_id:"all",name:"All"},...z.value]);async function P(){const t=await $("/api/blogs",{params:{page:n.page,limit:Ft,...n.category!=="all"?{category:n.category}:{}}},!0);return{results:t?.data?.results||[],pagination:t?.data?.pagination||{}}}function j(t=[]){const e=new Map(r.value.map(o=>[o._id,o]));t.forEach(o=>{e.has(o._id)||e.set(o._id,o)}),r.value=Array.from(e.values())}const B=b(()=>u.value<h.value);async function J(){if(!(!B.value||v.value)){v.value=!0;try{n.page=u.value+1,await D({append:!0})}finally{v.value=!1}}}async function D({append:t=!1}={}){const e=await P();t?j(e.results):r.value=e.results,u.value=e.pagination.currentPage||n.page,h.value=e.pagination.lastPage||u.value,await lt(),A()}function A(){x.value?.disconnect(),!(!w.value||!B.value)&&(x.value=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&J()},{root:null,rootMargin:"320px 0px"}),x.value.observe(w.value))}const k=([l,_]=S(()=>P()),l=await l,_(),l);r.value=k.results,u.value=k.pagination.currentPage||n.page,h.value=k.pagination.lastPage||u.value;const q=b(()=>({type:"Blog",name:F.value?.title||"Healthy Eating Blog | Nutrition Tips & Meal Planning | Fitlab",description:H("description")||"Read Fitlab blog articles on healthy eating, meal planning, and practical nutrition strategies to support your long-term wellness goals.",publisher:{type:"Organization",name:"Fitlab",logo:"https://fitlab-me.com/svg/logo.svg"},blogPosts:r.value.map(t=>ct({"@type":"BlogPosting",name:t.title,image:t.imageUrl,description:t.heading||t.description||E(t),author:t.author?{"@type":"Person",name:t.author}:void 0,articleSection:t.category?.name,dateModified:M(t.updatedAt),datePublished:M(t.publishOn)}))}));ut([q]),st(()=>{A()}),nt(()=>n.category,async()=>{x.value?.disconnect(),n.page=1,r.value=[],u.value=1,h.value=1,await D()}),ot(()=>{x.value?.disconnect()});function M(t){if(!t)return;const e=N.fromISO(t);return e.isValid?e.toJSDate():void 0}function G(t){if(!t)return"";const e=N.fromISO(t);return e.isValid?e.toFormat("LLLL dd, yyyy"):""}function E(t){return(t?.description||t?.heading||String(t?.content||"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim())?.slice(0,130)||"Read the full article on Fitlab Blog."}function H(t){return F.value?.metaTags?.find(e=>e.key?.toLowerCase()===t.toLowerCase())?.value}function Q(t){n.category!==t&&(n.category=t)}function O(t){const e=["bg-[#EBBF57]","bg-[#D6C9D4]","bg-[#F5D1CC]","bg-[#C9D9DB]","bg-[#CCEBF5]","bg-[#FFF7DE]","bg-[#F7EDF0]"],o=t?._id||t?.name||"all";let m=0;for(let f=0;f<o.length;
1f+=1)m=(m<<5)-m+o.charCodeAt(f),m|=0;return e[Math.abs(m)%e.length]}return(t,e)=>{const o=Z,m=K,f=W,X=tt,Y=et;return i(),c("div",null,[e[3]||(e[3]=s("section",{class:"mt-10 sm:mt-14 text-center max-sm:px-4"},[s("h1",{class:"text-2xl sm:text-4xl lg:text-5xl font-semibold"},"Our Blog"),s("p",{class:"mt-3 sm:mt-4 text-sm sm:text-base lg:text-lg max-w-3xl mx-auto text-[#4B5563]"}," Practical nutrition tips, meal-planning guidance, and healthy lifestyle insights from the Fitlab team to help you build better habits. ")],-1)),s("div",mt,[s("section",pt,[s("div",dt,[e[0]||(e[0]=s("h2",{class:"text-lg sm:text-2xl font-semibold text-[#001973] mb-4"}," Categories ",-1)),s("div",gt,[(i(!0),c(L,null,I(p(R),a=>(i(),c("button",{key:a._id,type:"button",class:V(["shrink-0 whitespace-nowrap rounded-full px-3 sm:px-5 py-1.5 sm:py-2 text-xs sm:text-sm lg:text-base font-medium transition-colors",p(n).category===a._id?"bg-[#001973] text-white":`${O(a)} text-[#001973] hover:opacity-80`]),onClick:Dt=>Q(a._id)},g(a.name),11,xt))),128))])]),s("div",ft,[(i(!0),c(L,null,I(p(r),a=>(i(),T(m,{key:a._id,to:`/blogs/${a.slug}`,class:"group relative min-h-[430px] rounded-[24px] sm:rounded-[32px] overflow-hidden"},{default:rt(()=>[a.imageUrl?(i(),T(o,{key:0,src:`${a.imageUrl}?t=${a.updatedAt}`,alt:a.title,class:"absolute inset-0 h-full w-full object-cover transition duration-300 group-hover:scale-[1.02]",loading:"lazy",placeholder:""},null,8,["src","alt"])):y("",!0),e[1]||(e[1]=s("div",{class:"absolute inset-0 bg-gradient-to-t from-black/90 via-black/50 to-transparent"},null,-1)),s("div",_t,[s("div",ht,[a.category?.name?(i(),c("span",{key:0,class:V([O(a.category),"text-[#001973] px-3 py-1 rounded-3xl"])},g(a.category.name),3)):y("",!0),s("span",vt,g(G(a.publishOn)),1)]),a.author?(i(),c("p",yt," By "+g(a.author),1)):y("",!0),s("h2",{class:"text-xl sm:text-3xl lg:text-2xl xl:text-3xl font-semibold leading-tight line-clamp-3",title:a.title},g(a.title),9,bt),s("p",wt,g(E(a)),1)])]),_:2},1032,["to"]))),128))]),s("div",Bt,[p(v)?(i(),c("div",kt," Loading more articles... ")):!p(B)&&p(r).length?(i(),c("div",Ct," You have reached the end of our blog articles. ")):y("",!0)]),s("div",{ref_key:"sentinel",ref:w,class:"h-2"},null,512)]),s("section",null,[e[2]||(e[2]=s("h2",{class:"text-xl sm:text-3xl lg:text-5xl font-semibold text-center"}," Questions you might ask ",-1)),C(f)])]),C(X),C(Y)])}}};export{zt 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.