1import{j as e,P as E,ad as B,N as L,X as $,e as o,B as y,ae as k,C as b,af as i,d as S,i as A,A as I}from"./index-DGo-vssZ.js";import{a as T,r as v,u as M,L as c}from"./vendor-Qgthw7N1.js";import{u as U}from"./useSEOMetaTags-DuPP1K7p.js";import{u as F,a as q}from"./useBlogPosts-DsWQ2kvn.js";import{B as D}from"./BlogSidebar-CxShR7dj.js";import{C as O}from"./calendar-days-COgXMVIl.js";import"./api-DBoyQ-on.js";const g=6;function _(a){return new Date(a).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function V({post:a}){var n,r;return e.jsx(c,{href:`/blog/${a.slug}`,children:e.jsxs(b,{className:"overflow-hidden cursor-pointer transition-colors hover:border-primary/30 group h-full",children:[a.featuredImageUrl&&e.jsx("div",{className:"aspect-[16/9] overflow-hidden bg-gray-100",children:e.jsx("img",{src:a.featuredImageUrl,alt:a.title,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",loading:"lazy"})}),e.jsxs(S,{className:"p-5",children:[e.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[a.category&&e.jsx(c,{href:`/blog?category=${a.category.slug}`,children:e.jsx(o,{variant:"secondary",className:"rounded-md cursor-pointer hover:bg-accent",children:a.category.name})}),(n=a.tags)==null?void 0:n.slice(0,2).map(s=>e.jsx(o,{variant:"outline",className:"rounded-md text-xs",children:s.name},s.id))]}),e.jsx("h3",{className:"text-lg font-semibold mb-2 line-clamp-2 group-hover:text-primary transition-colors",children:a.title}),e.jsx("p",{className:"text-sm text-gray-600 mb-4 line-clamp-3",children:a.excerpt}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500 mt-auto",children:[a.author&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-5 h-5 rounded-full bg-gray-200 inline-flex items-center justify-center text-[10px] font-medium text-gray-600",children:((r=a.author.fullName)==null?void 0:r.charAt(0))||"A"}),a.author.fullName]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O,{className:"w-3.5 h-3.5"}),_(a.publishedAt||a.createdAt)]}),a.readingTime&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(A,{className:"w-3.5 h-3.5"}),a.readingTime," min read"]})]}),e.jsx("div",{className:"mt-4 pt-3 border-t border-gray-100",children:e.jsxs("span",{className:"text-sm font-medium text-primary inline-flex items-center gap-1 group-hover:gap-2 transition-all",children:["Read more ",e.jsx(I,{className:"w-3.5 h-3.5"})]})})]})]})})}function z(){return e.jsxs(b,{className:"overflow-hidden",children:[e.jsx(i,{className:"aspect-[16/9] rounded-none"}),e.jsxs(S,{className:"p-5 space-y-3",children:[e.jsx(i,{className:"h-5 w-20 rounded-md"}),e.jsx(i,{className:"h-6 w-full"}),e.jsx(i,{className:"h-6 w-3/4"}),e.jsx(i,{className:"h-4 w-full"}),e.jsx(i,{className:"h-4 w-5/6"}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx(i,{className:"h-4 w-24"}),e.jsx(i,{className:"h-4 w-20"})]})]})]})}function Y(){const a=T(),n=new URLSearchParams(a),r=n.get("category")||void 0,s=n.get("search")||void 0,[u,f]=v.useState(0);v.useEffect(()=>{f(0)},[s,r]);const[,d]=M(),{data:m}=F(),w=l=>{l.preventDefault();const N=(new FormData(l.currentTarget).get("mobile-search")||"").trim();d(N?`/blog?search=${encodeURIComponent(N)}`:"/blog")},{data:t,isLoading:x,isFetching:p}=q({category:r,search:s,limit:g,offset:u}),h=(t==null?void 0:t.posts)||t||[],P=(t==null?void 0:t.total)||(t==null?void 0:t.totalCount)||0,C=u+g<P;U(s?`Search: ${s} â REPSShield Blog`:r?`${r} â REPSShield Blog`:"REPSShield Blog â Real Estate Professional Tax Strategies",s?`Search results for "${s}" on REPSShield Blog.`:"Real estate investor tax strategies, REPS qualification guides, and IRS compliance insights.");const R=()=>{f(l=>l+g)};return e.jsx(E,{hideEmailIntake:!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-gray-900 mb-4",children:"REPSShield Blog"}),e.jsx("p",{className:"text-lg text-gray-600 max-w-2xl mx-auto",children:"Real estate investor tax strategies, REPS qualification guides, and IRS compliance insights."})]}),e.jsxs("div",{className:"lg:hidden space-y-4 mb-8",children:[e.jsxs("form",{onSubmit:w,className:"relative",children:[e.jsx(B,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"}),e.jsx(L,{type:"text",name:"mobile-search",placeholder:"Search articles...",defaultValue:s,
1className:"pl-9 pr-9"}),s&&e.jsx("button",{type:"button",onClick:()=>d("/blog"),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:e.jsx($,{className:"w-4 h-4"})})]}),m&&m.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(c,{href:"/blog",children:e.jsx(o,{variant:r?"outline":"default",className:`rounded-md cursor-pointer text-sm px-4 py-1.5 ${r?"hover:bg-gray-100":"bg-primary hover:bg-primary/90"}`,children:"All"})}),m.map(l=>e.jsx(c,{href:`/blog?category=${l.slug}`,children:e.jsx(o,{variant:r===l.slug?"default":"outline",className:`rounded-md cursor-pointer text-sm px-4 py-1.5 ${r===l.slug?"bg-primary hover:bg-primary/90":"hover:bg-gray-100"}`,children:l.name})},l.id))]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-10",children:[e.jsxs("div",{className:"lg:col-span-2",children:[s&&!x&&e.jsx("p",{className:"text-sm text-gray-500 mb-6",children:h.length>0?`Search results for "${s}"`:`No results found for "${s}"`}),x?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:Array.from({length:4}).map((l,j)=>e.jsx(z,{},j))}):h.length===0&&!x?e.jsxs("div",{className:"text-center py-20",children:[e.jsx("p",{className:"text-xl text-gray-500 mb-4",children:s||r?"No articles found.":"No articles yet. Check back soon."}),(r||s)&&e.jsx(c,{href:"/blog",children:e.jsx(y,{variant:"outline",className:"rounded-md",children:s?"Clear search":"View all articles"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:h.map(l=>e.jsx(V,{post:l},l.id))}),C&&e.jsx("div",{className:"text-center mt-10",children:e.jsx(y,{variant:"outline",onClick:R,disabled:p,className:"rounded-md px-8",children:p?e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"w-4 h-4 mr-2 animate-spin"}),"Loading..."]}):"Load More"})})]})]}),e.jsx("div",{className:"lg:sticky lg:top-8 lg:self-start",children:e.jsx(D,{activeCategory:r})})]})]})})}export{Y 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.