(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2428],{24295:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>p});var a=t(95155),s=t(12115),l=t(42786),i=t(6874),n=t.n(i),d=t(53999),o=t(67624),c=t(1482),x=t(28883),m=t(22915),h=t(18533),g=t(1874);function p(){var e;let[r,t]=(0,s.useState)([]),[i,p]=(0,s.useState)([]),[u,y]=(0,s.useState)([]),[b,f]=(0,s.useState)("All"),[j,v]=(0,s.useState)(null),[N,k]=(0,s.useState)(!0),[w,S]=(0,s.useState)({email:"",name:""}),[A,D]=(0,s.useState)({}),[C,E]=(0,s.useState)(!1),[L,T]=(0,s.useState)("idle"),[F,P]=(0,s.useState)("");(0,s.useEffect)(()=>{(async()=>{try{k(!0),v(null);let e=(0,d.e)("/api/content/blog");console.log("Fetching blog posts from:",e);let r=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"},next:{revalidate:60}});if(!r.ok)throw Error("HTTP error! status: ".concat(r.status));let a=await r.json();if(a.error)throw Error(a.error);if(Array.isArray(a))t(a),p(a),y(["All",...Array.from(new Set(a.map(e=>e.category)))]);else throw Error("Invalid response format: expected array of blog posts")}catch(e){console.error("Failed to fetch blog posts:",e),v(e instanceof Error?e.message:"Failed to load blog posts")}finally{k(!1)}})()},[]),(0,s.useEffect)(()=>{"All"===b?p(r):p(r.filter(e=>e.category===b))},[b,r]);let R=async e=>{if(e.preventDefault(),(()=>{let e={};return w.email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(w.email)||(e.email="Please enter a valid email address"):e.email="Email is required",D(e),0===Object.keys(e).length})()){E(!0),T("idle"),P("");try{let e=await fetch("/api/newsletter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)}),r=await e.json();e.ok?(T("success"),P(r.message),S({email:"",name:""})):(T("error"),P(r.error||"Failed to subscribe. Please try again."))}catch(e){T("error"),P("Network error. Please check your connection and try again.")}finally{E(!1)}}},I=r.find(e=>e.isFeatured)||(r.length>0?r[0]:null);return i.filter(e=>e.id!==(null==I?void 0:I.id)),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.default,{pageTitle:"Blog - Data Protection Insights | ORGPYUR Technologies Inc.",pageDescription:"Latest insights, news, and best practices in data protection, compliance, and cybersecurity."}),(0,a.jsxs)("div",{className:"min-h-screen bg-white dark:bg-gray-900",children:[(0,a.jsxs)("section",{className:"relative bg-gradient-to-r from-primary-600 to-primary-800 dark:from-primary-800 dark:to-primary-900",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/20"}),(0,a.jsx)("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsxs)("h1",{className:"text-3xl md:text-5xl font-bold text-white mb-3 tracking-tight",children:["Latest ",(0,a.jsx)("span",{className:"text-primary-200",children:"Insights"})]}),(0,a.jsx)("p",{className:"text-base md:text-lg text-primary-100 max-w-2xl mx-auto leading-relaxed",children:"Explore our comprehensive coverage of data protection, compliance strategies, and cybersecurity innovations"})]})})]}),j&&(0,a.jsx)("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto text-center",children:(0,a.jsxs)("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-2xl p-8",children:[(0,a.jsx)("div",{className:"text-red-600 dark:text-red-400 text-6xl mb-4",children:"⚠️"}),(0,a.jsx)("h2",{className:"text-2xl font-bold text-red-800 dark:text-red-300 mb-2",children:"Unable to Load Blog Posts"}),(0,a.jsx)("p",{className:"text-red-600 dark:text-red-400 mb-4",children:j}),(0,a.jsx)("button",{onClick:()=>window.location.reload(),className:"inline-block bg-red-600 hover:bg-red-700 text-white px-6 py-3 rounded-lg font-semibold transition-colors duration-300",children:"Try Again"})]})})}),N&&(0,a.jsx)("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto text-center",children:(0,a.jsxs)("div",{className:"flex items-center justify-center space-x-2",children:[(0,a.jsx)(o.A,{className:"h-8 w-8 animate-spin text-primary-600"}),(0,a.jsx)("span",{className:"text-lg text-gray-600 dark:text-gray-300",children:"Loading blog posts..."})]})})}),!N&&!j&&0===r.length&&(0,a.jsx)("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto text-center",children:(0,a.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-800 rounded-2xl p-12",children:[(0,a.jsx)("div",{className:"text-gray-400 dark:text-gray-500 text-6xl mb-6",children:"\uD83D\uDCDD"}),(0,a.jsx)("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:"No Blog Posts Yet"}),(0,a.jsx)("p",{className:"text-xl text-gray-600 dark:text-gray-300 mb-8",children:"We're working on bringing you the latest insights and articles. Check back soon!"}),(0,a.jsx)("button",{onClick:()=>f("All"),className:"bg-primary-600 hover:bg-primary-700 text-white px-8 py-4 rounded-xl font-semibold transition-colors duration-300",children:"Subscribe for Updates"})]})})}),!N&&!j&&I&&(0,a.jsx)("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-gray-50 dark:bg-gray-800",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,a.jsxs)("div",{className:"text-center mb-12",children:[(0,a.jsx)("span",{className:"text-primary-600 dark:text-primary-400 font-semibold text-sm uppercase tracking-wider",children:I.isFeatured?"⭐ Featured Article":"Latest Article"}),(0,a.jsx)("h2",{className:"text-3xl md:text-4xl font-bold text-gray-900 dark:text-white mt-2",children:I.isFeatured?"Editor's Pick":"Must Read"})]}),(0,a.jsx)(n(),{href:"/".concat(I.slug),className:"group block",children:(0,a.jsx)("div",{className:"bg-white dark:bg-gray-900 rounded-3xl shadow-2xl overflow-hidden hover:shadow-3xl transition-all duration-500 transform hover:scale-[1.02]",children:(0,a.jsxs)("div",{className:"lg:grid lg:grid-cols-2 lg:gap-8",children:[(0,a.jsxs)("div",{className:"relative h-64 lg:h-full bg-gradient-to-br from-primary-100 to-primary-200 dark:from-primary-900 dark:to-primary-800 flex items-center justify-center",children:[(0,a.jsx)("div",{className:"text-8xl opacity-60",children:"string"==typeof I.image?I.image:"\uD83D\uDCDD"}),(0,a.jsx)("div",{className:"absolute top-6 left-6",children:(0,a.jsx)("span",{className:"bg-primary-600 text-white px-4 py-2 rounded-full text-sm font-semibold",children:I.category})})]}),(0,a.jsxs)("div",{className:"p-8 lg:p-12 flex flex-col justify-center",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"})}),(0,a.jsx)("span",{className:"text-sm",children:I.date?new Date(I.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):""})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})}),(0,a.jsx)("span",{className:"text-sm",children:I.readTime||"5 min read"})]})]}),(0,a.jsx)("h3",{className:"text-3xl lg:text-4xl font-bold text-gray-900 dark:text-white mb-4 group-hover:text-primary-600 dark:group-hover:text-primary-400 transition-colors duration-300",children:I.title}),(0,a.jsx)("p",{className:"text-xl text-gray-600 dark:text-gray-300 mb-6 leading-relaxed",children:I.excerpt}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-12 h-12 bg-gradient-to-r from-primary-400 to-primary-600 rounded-full flex items-center justify-center",children:(0,a.jsx)("span",{className:"text-white font-bold",children:null==(e=I.author)?void 0:e.split(" ").map(e=>e[0]).join("")})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold text-gray-900 dark:text-white",children:I.author}),(0,a.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Content Specialist"})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-primary-600 dark:text-primary-400 font-semibold group-hover:gap-4 transition-all duration-300",children:[(0,a.jsx)("span",{children:"Read Article"}),(0,a.jsx)("svg",{className:"w-5 h-5 transform group-hover:translate-x-1 transition-transform duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 8l4 4m0 0l-4 4m4-4H3"})})]})]})]})]})})})]})}),!N&&!j&&r.length>0&&(0,a.jsx)("section",{className:"py-12 px-4 sm:px-6 lg:px-8",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,a.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-100 dark:border-gray-700 p-6 mb-8",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(c.A,{className:"h-5 w-5 text-primary-600"}),(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Filter by Topic"})]}),(0,a.jsxs)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:[i.length," article",1!==i.length?"s":"","All"!==b&&" in ".concat(b)]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:u.map(e=>(0,a.jsx)("button",{onClick:()=>f(e),className:"px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200 ".concat(b===e?"bg-primary-600 text-white shadow-md":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-primary-50 dark:hover:bg-primary-900/20 hover:text-primary-600 dark:hover:text-primary-400"),children:e},e))})]}),i.length>0?(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:i.map((e,r)=>{var t,s;return(0,a.jsx)("article",{className:"group bg-white dark:bg-gray-800 rounded-2xl shadow-lg hover:shadow-2xl transition-all duration-500 overflow-hidden border border-gray-100 dark:border-gray-700 transform hover:scale-105",style:{animationDelay:"".concat(100*r,"ms")},children:(0,a.jsxs)(n(),{href:"/".concat(e.slug),className:"block",children:[(0,a.jsxs)("div",{className:"relative h-48 bg-gradient-to-br from-gray-100 to-gray-200 dark:from-gray-700 dark:to-gray-800 flex items-center justify-center overflow-hidden",children:[e.featuredImage?(0,a.jsx)(g.A,{src:"string"==typeof e.featuredImage?e.featuredImage:e.featuredImage.url,alt:e.title,width:400,height:200,className:"object-cover group-hover:scale-110 transition-transform duration-500 w-full h-full"}):(0,a.jsx)("div",{className:"text-6xl opacity-80 group-hover:scale-110 transition-transform duration-500",children:"string"==typeof e.image?e.image:"\uD83D\uDCDD"}),(0,a.jsx)("div",{className:"absolute top-4 left-4",children:(0,a.jsx)("span",{className:"bg-white/90 backdrop-blur text-gray-700 px-3 py-1 rounded-full text-xs font-semibold",children:e.category})}),(0,a.jsx)("div",{className:"absolute bottom-4 right-4",children:(0,a.jsx)("span",{className:"bg-black/70 text-white px-2 py-1 rounded text-xs",children:e.readTime||"5 min"})})]}),(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-3 text-sm text-gray-500 dark:text-gray-400",children:[(0,a.jsx)("span",{children:e.date?new Date(e.date).toLocaleDateString("en-US",{month:"short",day:"numeric"}):""}),(0,a.jsx)("span",{children:"•"}),(0,a.jsx)("span",{children:e.author})]}),(0,a.jsx)("h3",{className:"text-xl font-bold text-gray-900 dark:text-white mb-3 group-hover:text-primary-600 dark:group-hover:text-primary-400 transition-colors duration-300 line-clamp-2",children:e.title}),(0,a.jsx)("p",{className:"text-gray-600 dark:text-gray-300 mb-4 line-clamp-3 leading-relaxed",children:e.excerpt}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-8 h-8 bg-gradient-to-r from-primary-400 to-primary-600 rounded-full flex items-center justify-center",children:(0,a.jsx)("span",{className:"text-white text-xs font-bold",children:null==(t=e.author)?void 0:t.split(" ").map(e=>e[0]).join("")})}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:null==(s=e.author)?void 0:s.split(" ")[0]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 text-primary-600 dark:text-primary-400 font-medium text-sm group-hover:gap-2 transition-all duration-300",children:[(0,a.jsx)("span",{children:"Read"}),(0,a.jsx)("svg",{className:"w-4 h-4 transform group-hover:translate-x-1 transition-transform duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})},e.id)})}):(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"text-gray-400 dark:text-gray-500 text-6xl mb-4",children:"\uD83D\uDCDD"}),(0,a.jsx)("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"No articles found"}),(0,a.jsxs)("p",{className:"text-gray-600 dark:text-gray-300 mb-4",children:['No articles found in the "',b,'" category.']}),(0,a.jsx)("button",{onClick:()=>f("All"),className:"text-primary-600 dark:text-primary-400 hover:text-primary-700 dark:hover:text-primary-300 font-medium",children:"View all articles"})]}),i.length>0&&(0,a.jsx)("div",{className:"text-center mt-16",children:(0,a.jsx)("button",{className:"bg-gradient-to-r from-primary-600 to-primary-700 hover:from-primary-700 hover:to-primary-800 text-white font-semibold py-4 px-10 rounded-xl transition-all duration-300 transform hover:scale-105 shadow-lg hover:shadow-xl",children:"Load More Articles"})})]})}),(0,a.jsx)("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-gradient-to-r from-primary-600 to-primary-800 dark:from-primary-800 dark:to-primary-900",children:(0,a.jsxs)("div",{className:"max-w-4xl mx-auto text-center",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-white/20 rounded-2xl mb-6",children:(0,a.jsx)(x.A,{className:"w-8 h-8 text-white"})}),(0,a.jsx)("h2",{className:"text-4xl md:text-5xl font-bold text-white mb-6",children:"Never Miss an Update"}),(0,a.jsx)("p",{className:"text-xl text-primary-100 leading-relaxed",children:"Get exclusive insights, industry reports, and expert analysis delivered weekly to your inbox"})]}),"success"===L&&(0,a.jsx)("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg",children:(0,a.jsxs)("div",{className:"flex items-center justify-center",children:[(0,a.jsx)(m.A,{className:"h-5 w-5 text-green-600 dark:text-green-400 mr-2"}),(0,a.jsx)("p",{className:"text-green-800 dark:text-green-200",children:F})]})}),"error"===L&&(0,a.jsx)("div",{className:"mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",children:(0,a.jsxs)("div",{className:"flex items-center justify-center",children:[(0,a.jsx)(h.A,{className:"h-5 w-5 text-red-600 dark:text-red-400 mr-2"}),(0,a.jsx)("p",{className:"text-red-800 dark:text-red-200",children:F})]})}),(0,a.jsxs)("form",{onSubmit:R,className:"flex flex-col sm:flex-row gap-4 max-w-lg mx-auto",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("input",{type:"email",name:"email",value:w.email,onChange:e=>{let{name:r,value:t}=e.target;S(e=>({...e,[r]:t})),A[r]&&D(e=>({...e,[r]:void 0}))},placeholder:"Enter your email address",className:"w-full px-6 py-4 border-0 rounded-xl focus:ring-4 focus:ring-white/30 focus:outline-none text-gray-900 placeholder-gray-500 shadow-lg ".concat(A.email?"ring-2 ring-red-500":"")}),A.email&&(0,a.jsx)("p",{className:"mt-1 text-sm text-red-200",children:A.email})]}),(0,a.jsx)("button",{type:"submit",disabled:C,className:"bg-white text-primary-600 font-semibold py-4 px-8 rounded-xl hover:bg-primary-50 transition-all duration-300 transform hover:scale-105 shadow-lg flex items-center justify-center",children:C?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Subscribing..."]}):"Subscribe"})]}),(0,a.jsx)("p",{className:"text-primary-200 text-sm mt-4",children:"Join 10,000+ professionals. Unsubscribe anytime."})]})})]})]})}},58243:(e,r,t)=>{Promise.resolve().then(t.bind(t,24295))}},e=>{e.O(0,[9695,8096,7358],()=>e(e.s=58243)),_N_E=e.O()}]);