1import{c as J,r as c,j as e,a as d,b as K,d as Y,m as w,X as Z}from"./index-DXCoRI9B.js";import{P as ee}from"./PageHeader-BmpNPS9n.js";import{B as te}from"./BlogCard-JEsNc_7O.js";import{u as ae}from"./useBlogs-TFqyJm90.js";import{I as se}from"./input-CeczFVps.js";import{S as re,a as ne,b as ie,c as oe,d as I}from"./select-Ddyiqxro.js";import{b as le}from"./button-De3-SOrj.js";import{C as ce,a as de,S as A}from"./search-BjQI3AqO.js";import{P as me}from"./PageSEO-BXRV8swi.js";import{B as h}from"./book-open-Dc0QkjTB.js";import{F as pe}from"./filter-Cw00UQeQ.js";import{L as xe}from"./loader-circle-Z4oyFH0Q.js";import"./format-CfIxQnRx.js";import"./sparkles-3nWlS-qe.js";import"./clock-C_ceyPse.js";import"./arrow-right-BSTfpohg.js";import"./useQuery-DMHgs6f2.js";import"./client-C2zUM7hM.js";import"./index-Cggv0CRy.js";import"./index-jgNYDpgS.js";import"./index-7yIGywko.js";import"./check-BmoKgPsi.js";import"./seo-C1nxFO30.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ge=J("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),M=({className:r,...a})=>e.jsx("nav",{role:"navigation","aria-label":"pagination",className:d("mx-auto flex w-full justify-center",r),...a});M.displayName="Pagination";const T=c.forwardRef(({className:r,...a},n)=>e.jsx("ul",{ref:n,className:d("flex flex-row items-center gap-1",r),...a}));T.displayName="PaginationContent";const f=c.forwardRef(({className:r,...a},n)=>e.jsx("li",{ref:n,className:d("",r),...a}));f.displayName="PaginationItem";const y=({className:r,isActive:a,size:n="icon",...j})=>e.jsx("a",{"aria-current":a?"page":void 0,className:d(le({variant:a?"outline":"ghost",size:n}),r),...j});y.displayName="PaginationLink";const H=({className:r,...a})=>e.jsxs(y,{"aria-label":"Go to previous page",size:"default",className:d("gap-1 pl-2.5",r),...a,children:[e.jsx(ce,{className:"h-4 w-4"}),e.jsx("span",{children:"Previous"})]});H.displayName="PaginationPrevious";const V=({className:r,...a})=>e.jsxs(y,{"aria-label":"Go to next page",size:"default",className:d("gap-1 pr-2.5",r),...a,children:[e.jsx("span",{children:"Next"}),e.jsx(de,{className:"h-4 w-4"})]});V.displayName="PaginationNext";const _=({className:r,...a})=>e.jsxs("span",{"aria-hidden":!0,className:d("flex h-9 w-9 items-center justify-center",r),...a,children:[e.jsx(ge,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"More pages"})]});_.displayName="PaginationEllipsis";const ue=K("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function he({className:r,variant:a,...n}){return e.jsx("div",{className:d(ue({variant:a}),r),...n})}class fe extends c.Component{constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,n){console.error("Blogs Page Error:",a,n)}render(){return this.state.hasError?e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:e.jsxs("div",{className:"glass-card p-8 max-w-md text-center border-red-500/30 bg-red-500/5",children:[e.jsx(h,{className:"w-12 h-12 text-red-400 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-bold text-foreground mb-2",children:"Something went wrong"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"We couldn't load the blog posts. Please try again."}),e.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Reload Page"})]})}):this.props.children}}const C=24;function ye(){const[r,a]=Y(),{data:n,isLoading:j,error:G}=ae(),[N,P]=c.useState(""),[x,g]=c.useState("all"),[m,b]=c.useState(null),[i,l]=c.useState(1);c.useEffect(()=>{const t=r.get("category"),s=r.get("tag");t&&g(t),s&&b(s),(t||s)&&a({},{replace:!0})},[r,a]);const u=Array.isArray(n)?n:[],S=[...new Set(u.flatMap(t=>{var s;return((s=t.category)==null?void 0:s.split(", ").map(p=>p.trim()))||[]}).filter(t=>!!t))],k=[...new Set(u.flatMap(t=>{var s;return((s=t.keywords)==null?void 0:s.split(",").map(p=>p.trim()))||[]}).filter(t=>!!t))].slice(0,20),v=u.filter(t=>{var L,F;const s=t.title.toLowerCase().includes(N.toLowerCase()),p=((L=t.category)==null?void 0:L.split(", ").map($=>$.trim()))||[],W=x==="all"||p.includes(x),X=!m||((F=t.keywords)==null?void 0:F.toLowerCase().includes(m.toLowerCase()));return s&&W&&X}),o=Math.ceil(v.length/C),B=(i-1)*C,E=v.slice(B,B+C),q=t=>{P(t),l(1)},z=t=>{g(t),l(1)}
6,O=t=>{g(t),l(1)},D=t=>{b(t===m?null:t),l(1)},R=()=>{P(""),g("all"),b(null),l(1)},Q=N||x!=="all"||m,U=()=>{const t=[];if(o<=5)for(let s=1;s<=o;s++)t.push(s);else{t.push(1),i>3&&t.push("ellipsis");for(let s=Math.max(2,i-1);s<=Math.min(o-1,i+1);s++)t.push(s);i<o-2&&t.push("ellipsis"),t.push(o)}return t};return G?e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:e.jsxs("div",{className:"glass-card p-8 max-w-md text-center",children:[e.jsx(h,{className:"w-12 h-12 text-muted-foreground mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-bold text-foreground mb-2",children:"Unable to load blogs"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Please check your connection and try again."}),e.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Retry"})]})}):e.jsxs(e.Fragment,{children:[e.jsx(me,{title:"Insights & Articles - HR, Talent & Leadership Blog",description:"Expert perspectives on HR, talent acquisition, and leadership. Read our latest articles on recruitment, employee engagement, and people management strategies.",path:"/blogs",keywords:"HR blog, talent acquisition articles, leadership insights, recruitment tips, employee engagement, HR best practices"}),e.jsx(ee,{title:"Insights & Articles",subtitle:"Expert perspectives on HR, talent, and leadership.",badge:"Blog",badgeIcon:h}),e.jsx("section",{className:"section-spacing",children:e.jsxs("div",{className:"page-container",children:[e.jsxs(w.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"flex flex-col gap-4 mb-8",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(se,{placeholder:"Search articles...",value:N,onChange:t=>q(t.target.value),className:"pl-10 bg-card border-border/50"})]}),S.length>0&&e.jsxs(re,{value:x,onValueChange:z,children:[e.jsxs(ne,{className:"w-full sm:w-48 bg-card border-border/50",children:[e.jsx(pe,{className:"w-4 h-4 mr-2 text-muted-foreground"}),e.jsx(ie,{placeholder:"All Categories"})]}),e.jsxs(oe,{children:[e.jsx(I,{value:"all",children:"All Categories"}),S.map(t=>e.jsx(I,{value:t,children:t},t))]})]}),Q&&e.jsxs("button",{onClick:R,className:"flex items-center gap-2 px-4 py-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(Z,{className:"w-4 h-4"}),"Clear filters"]})]}),k.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:k.map(t=>e.jsx(he,{variant:m===t?"default":"outline",className:`cursor-pointer transition-all hover:scale-105 ${m===t?"bg-primary text-primary-foreground":"hover:bg-primary/10"}`,onClick:()=>D(t),children:t},t))})]}),j?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(xe,{className:"w-8 h-8 animate-spin text-primary"})}):E.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:E.map((t,s)=>e.jsx(te,{title:t.title,slug:t.slug,excerpt:t.excerpt,publishedAt:t.published_at,readTime:t.read_time,category:t.category,thumbnailUrl:t.thumbnail_url,index:s,showNewBadge:!0,onCategoryClick:O},t.id))}),o>1&&e.jsxs("div",{className:"mt-12",children:[e.jsx(M,{children:e.jsxs(T,{children:[e.jsx(f,{children:e.jsx(H,{onClick:()=>l(t=>Math.max(1,t-1)),className:i===1?"pointer-events-none opacity-50":"cursor-pointer"})}),U().map((t,s)=>e.jsx(f,{children:t==="ellipsis"?e.jsx(_,{}):e.jsx(y,{onClick:()=>l(t),isActive:i===t,className:"cursor-pointer",children:t})},s)),e.jsx(f,{children:e.jsx(V,{onClick:()=>l(t=>Math.min(o,t+1)),className:i===o?"pointer-events-none opacity-50":"cursor-pointer"})})]})}),e.jsxs("p",{className:"text-center text-muted-foreground text-sm mt-4",children:["Page ",i," of ",o," (",v.length," articles)"]})]})]}):u.length>0?e.jsxs(w.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass-card p-16 text-center",children:[e.jsx(A,{className:"w-16 h-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"No matching articles"}),e.jsx("p",{className:"text-muted-foreground max-w-md mx-auto mb-4",children:"No articles match your current filters. Try adjusting your search or category."}),e.jsx("button",{onClick:R,className:"text-primary hover:underline",children:"Clear filters"})]}):e.jsxs(w.div,{initial:{opacity:0,y:20}
6,animate:{opacity:1,y:0},className:"glass-card p-16 text-center",children:[e.jsx(h,{className:"w-16 h-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Coming Soon"}),e.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"We're working on some insightful content. Check back soon for articles on HR, talent acquisition, and leadership."})]})]})})]})}function ze(){return e.jsx(fe,{children:e.jsx(ye,{})})}export{ze 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.