1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7706],{3809:(e,r,t)=>{t.d(r,{default:()=>n});var a=t(51567),s=t(95155);function n(e){let{locale:r,...t}=e;if(!r)throw Error(void 0);return(0,s.jsx)(a.Dk,{locale:r,...t})}},20032:(e,r,t)=>{t.d(r,{BlogList:()=>b});var a=t(95155),s=t(12115),n=t(52619),l=t.n(n),i=t(15239),o=t(73127),d=t(71847);let c=(0,d.A)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var m=t(39347),u=t(26983);let h=(0,d.A)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var f=t(6132),x=t(35299);let g=(0,d.A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var p=t(90488);function b(e){let{initialBlogs:r,totalBlogs:t,hasMore:n,infinite:d=!0}=e,[b,v]=(0,s.useState)(r),[w,N]=(0,s.useState)(!1),[j,y]=(0,s.useState)(null),[k,A]=(0,s.useState)({currentPage:1,totalPages:Math.ceil(t/30),totalBlogs:t,hasMore:n,limit:30}),E=(0,s.useRef)(null),L=(0,s.useRef)(null),C=(0,s.useCallback)(async(e,r)=>{try{let t=new URL("/api/blogs",window.location.origin);t.searchParams.set("page",String(e)),t.searchParams.set("limit",String(30)),r&&t.searchParams.set("lastDocId",r);let a=await fetch(t.toString());if(!a.ok)throw Error("Failed to fetch blogs");return await a.json()}catch(e){throw console.error("Error fetching blogs:",e),e}},[]),M=(0,s.useCallback)(async()=>{if(k.hasMore&&!w)try{var e;N(!0);let r=k.currentPage+1,t=await C(r,null!=(e=k.lastDocId)?e:null);v(e=>[...e,...t.blogs]),A(t.pagination)}catch(e){console.error("Error loading more blogs:",e),y("Failed to load more posts")}finally{N(!1)}},[k,w,C]);return((0,s.useEffect)(()=>{if(!d||!k.hasMore)return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&k.hasMore&&!w&&M()},{threshold:.1});return L.current&&e.observe(L.current),E.current=e,()=>{E.current&&E.current.disconnect()}},[d,k.hasMore,w,M]),0===b.length)?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-foreground mb-2",children:"No blog posts yet"}),(0,a.jsx)("p",{className:"text-muted-foreground",children:"Check back soon for new content!"})]}):(0,a.jsxs)("div",{className:"space-y-12",children:[(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 lg:gap-10",children:b.map((e,r)=>{var t;return(0,a.jsxs)("div",{className:"relative flex grow w-full",children:[(0,a.jsx)(p.A,{blog:e,variant:"icon"}),(0,a.jsxs)("div",{className:"group relative bg-card rounded-2xl shadow-sm hover:shadow-xl transition-all duration-500 overflow-hidden border h-full flex flex-col border-border",children:[(0,a.jsxs)("div",{className:"relative overflow-hidden aspect-[16/10] min-h-[250px] w-full",children:[e.coverImage?(0,a.jsx)(i.default,{src:e.coverImage,alt:e.title,fill:!0,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",priority:r<=3,className:"object-cover group-hover:scale-110 transition-transform duration-700 ease-out"}):(0,a.jsx)("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:(0,a.jsx)("div",{className:"text-muted-foreground/50 text-4xl",children:(0,a.jsx)(c,{className:"w-16 h-16"})})}),(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/20 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),(0,a.jsxs)("div",{className:"absolute top-4 left-4 flex gap-2 z-20 pointer-events-none",children:[e.category&&(0,a.jsx)(l(),{href:"/blog/category/".concat((t=e.category,(0,o.Y)(t))),className:"pointer-events-auto px-3 py-1.5 rounded-full bg-background/90 backdrop-blur-sm text-muted-foreground text-xs font-semibold shadow-sm border border-border/50 hover:text-primary-gradient-first transition-colors",children:e.category}),e.featured&&(0,a.jsxs)("span",{className:"px-3 py-1.5 rounded-full bg-gradient-to-r from-yellow-400/90 to-orange-400/90 backdrop-blur-sm text-white text-xs font-semibold shadow-sm flex items-center gap-1",children:[(0,a.jsx)(m.A,{className:"w-3 h-3 fill-current"}),"Featured"]})]})]}),(0,a.jsxs)("div",{className:"p-6 flex flex-col flex-grow",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("time",{className:"text-sm text-muted-foreground font-medium",children:function(e){try{let r=new Date(e);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long",day:"numeric"}).format(r)}catch(r){return e}}(e.createdAt)}),e.updatedAt&&e.updatedAt!==e.createdAt&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground italic",children:"(Updated)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,a.jsx)(u.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{className:"font-medium text-muted-foreground",children:e.readingTime})]})]}),(0,a.jsx)("h3",{className:"text-xl lg:text-2xl font-bold text-foreground mb-4 leading-tight group-hover:text-foreground
1/80 transition-colors duration-200 font-poppins flex items-start gap-2",children:(0,a.jsxs)(l(),{href:"/blog/".concat(e.slug),children:[(0,a.jsx)("span",{className:"absolute inset-0","aria-hidden":"true"}),e.title]})}),e.description&&(0,a.jsx)("p",{className:"text-muted-foreground text-sm leading-relaxed mb-6 line-clamp-3",children:e.description}),e.tags.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 mb-6",children:[e.tags.slice(0,3).map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-md text-xs font-semibold bg-muted border border-border text-muted-foreground hover:bg-muted/80 transition-all duration-200",children:["#",e]},e)),e.tags.length>3&&(0,a.jsxs)("span",{className:"text-xs text-muted-foreground font-medium",children:["+",e.tags.length-3," more"]})]}),(0,a.jsx)("div",{className:"pt-2 flex self-end mt-auto",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-1.5 text-primary font-semibold transition-all duration-200 group-hover:gap-2.5",children:["Read article",(0,a.jsx)(h,{className:"w-4 h-4"})]})})]})]})]},e.slug)})}),d&&j&&(0,a.jsx)("div",{className:"text-center py-12",children:(0,a.jsxs)("div",{className:"inline-flex flex-col items-center p-8 bg-red-50 rounded-2xl border border-red-100",children:[(0,a.jsx)(f.A,{className:"w-12 h-12 text-red-400 mb-4"}),(0,a.jsx)("p",{className:"text-red-600 mb-4 font-medium",children:j}),(0,a.jsx)("button",{onClick:()=>{y(null),M()},className:"px-6 py-3 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors font-medium shadow-sm",children:"Try again"})]})}),d&&k.hasMore&&!j&&(0,a.jsx)("div",{ref:L,className:"text-center py-16",children:(0,a.jsxs)("div",{className:"inline-flex items-center px-8 py-4 text-muted-foreground bg-card rounded-2xl shadow-sm border border-border",children:[(0,a.jsx)(x.A,{className:"w-5 h-5 text-primary-blue animate-spin mr-3"}),(0,a.jsx)("span",{className:"font-medium",children:"Loading more articles..."})]})}),d&&!k.hasMore&&b.length>0&&(0,a.jsx)("div",{className:"text-center py-16",children:(0,a.jsxs)("div",{className:"inline-flex items-center px-8 py-4 text-muted-foreground bg-card rounded-2xl shadow-sm border border-border",children:[(0,a.jsx)(g,{className:"w-5 h-5 text-green-500 mr-3"}),(0,a.jsx)("span",{className:"font-medium",children:"You've reached the end of all articles!"})]})})]})}},26541:(e,r,t)=>{t.d(r,{D:()=>a});let a=(0,t(84497).A)({locales:["en","it","pt","fr","de","es"],defaultLocale:"en",localePrefix:"as-needed",localeDetection:!1,alternateLinks:!1})},26983:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(71847).A)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},34663:(e,r,t)=>{t.d(r,{N_:()=>n,a8:()=>i});var a=t(55251),s=t(26541);let{Link:n,redirect:l,usePathname:i,useRouter:o,getPathname:d}=(0,a.A)(s.D)},35299:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(71847).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},39347:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(71847).A)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]])},40323:(e,r,t)=>{t.d(r,{default:()=>v});var a=t(95155),s=t(12115),n=t(15239),l=t(65229),i=t(9540),o=t(18955),d=t(34663),c=t(51567),m=t(39068),u=t(24033),h=t(5917),f=t(26541);let x={en:"English",it:"Italiano",pt:"Portugu\xeas",fr:"Fran\xe7ais",de:"Deutsch",es:"Espa\xf1ol"},g={en:"EN",it:"IT",pt:"PT",fr:"FR",de:"DE",es:"ES"};function p(){var e,r;let t=(0,c.Ym)(),n=(0,d.a8)(),[l,i]=(0,s.useState)(!1),o=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!l)return;let e=e=>{"Escape"===e.key&&i(!1)},r=e=>{o.current&&!o.current.contains(e.target)&&i(!1)};return window.addEventListener("keydown",e),document.addEventListener("pointerdown",r),()=>{window.removeEventListener("keydown",e),document.removeEventListener("pointerdown",r)}},[l]),(0,a.jsxs)("div",{className:"mf-lang",ref:o,children:[(0,a.jsxs)("button",{type:"button",className:"mf-lang-toggle","aria-haspopup":"menu","aria-expanded":l,"aria-label":"Language: ".concat(null!=(e=x[t])?e:t),onClick:()=>i(e=>!e),children:[(0,a.jsx)(m.A,{className:"w-4 h-4","aria-hidden":"true"}),(0,a.jsx)("span",{className:"mf-lang-current",children:null!=(r=g[t])?r:t.toUpperCase()}),(0,a.jsx)(u.A,{className:"mf-lang-caret w-3.5 h-3.5","aria-hidden":"true"})]}),(0,a.jsx)("div",{className:"mf-lang-menu",role:"menu","data-open":l||void 0,children:f.D.locales.map(e=>{let r=e===t,s="pt"===e?"pt-BR":e,l=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:x[e]}),r&&(0,a.jsx)(h.A,{className:"w-3.5 h-3.5","aria-hidden":"true"})]});return e===f.D.defaultLocale?(0,a.jsx)("a",{href:n,hrefLang:s,className:"mf-lang-item",role:"menuitem","aria-current":r?"true":void 0,"data-active":r||void 0,onClick:()=>i(!1),children:l},e):(0,a.jsx)(d.N_,{href:n,locale:e,hrefLang:s,className:"mf-lang-item",role:"menuitem","aria-current":r?"true":void 0,"data-active":r||void 0,onClick:()=>i(!1),children:l},e)})})]})}let b=[{key:"features",href:"/#features"},{key:"blog",href:"/blog",en:!0},{key:"support",href:"/support"}];
1function v(){let e=(0,o.c)("Nav"),[r,t]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(!r)return;let e=e=>{"Escape"===e.key&&t(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r]),(0,s.useEffect)(()=>{if(!r)return;let e=e=>{let r=document.querySelector(".mf-header");r&&!r.contains(e.target)&&t(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[r]),(0,s.useEffect)(()=>{let e=window.matchMedia("(min-width: 900px)"),r=()=>{e.matches&&t(!1)};return e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),(0,a.jsxs)("header",{className:"mf-header",children:[(0,a.jsxs)("div",{className:"mf-container mf-header-inner",children:[(0,a.jsxs)(d.N_,{href:"/",className:"mf-brand","aria-label":e("home"),onClick:()=>t(!1),children:[(0,a.jsx)("span",{className:"mf-brand-mark",children:(0,a.jsx)(n.default,{src:"/img/logo.webp",alt:"",width:30,height:30,priority:!0})}),(0,a.jsx)("span",{className:"mf-brand-word font-display",children:"Moodflow"})]}),(0,a.jsx)("nav",{className:"mf-nav","aria-label":e("primaryAria"),children:b.map(r=>r.en?(0,a.jsx)("a",{href:r.href,className:"mf-nav-link",children:e(r.key)},r.href):(0,a.jsx)(d.N_,{href:r.href,className:"mf-nav-link",children:e(r.key)},r.href))}),(0,a.jsxs)("div",{className:"mf-header-actions",children:[(0,a.jsx)(p,{}),(0,a.jsx)(d.N_,{href:"/#get",className:"mf-btn mf-btn-primary mf-header-cta",children:e("getApp")}),(0,a.jsx)("button",{type:"button",className:"mf-nav-toggle","aria-expanded":r,"aria-controls":"mf-mobile-menu","aria-label":r?e("closeMenu"):e("openMenu"),onClick:()=>t(e=>!e),children:r?(0,a.jsx)(l.A,{className:"w-5 h-5"}):(0,a.jsx)(i.A,{className:"w-5 h-5"})})]})]}),(0,a.jsx)("div",{className:"mf-mobile-menu",id:"mf-mobile-menu","data-open":r||void 0,children:(0,a.jsxs)("nav",{className:"mf-mobile-nav","aria-label":e("mobileAria"),children:[b.map(r=>r.en?(0,a.jsx)("a",{href:r.href,className:"mf-mobile-link",onClick:()=>t(!1),children:e(r.key)},r.href):(0,a.jsx)(d.N_,{href:r.href,className:"mf-mobile-link",onClick:()=>t(!1),children:e(r.key)},r.href)),(0,a.jsx)(d.N_,{href:"/#get",className:"mf-btn mf-btn-primary mf-mobile-cta",onClick:()=>t(!1),children:e("getApp")})]})})]})}},71847:(e,r,t)=>{t.d(r,{A:()=>o});var a=t(12115);let s=e=>{let r=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,t)=>t?t.toUpperCase():r.toLowerCase());return r.charAt(0).toUpperCase()+r.slice(1)},n=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.filter((e,r,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim()};var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,a.forwardRef)((e,r)=>{let{color:t="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:d="",children:c,iconNode:m,...u}=e;return(0,a.createElement)("svg",{ref:r,...l,width:s,height:s,stroke:t,strokeWidth:o?24*Number(i)/Number(s):i,className:n("lucide",d),...!c&&!(e=>{for(let r in e)if(r.startsWith("aria-")||"role"===r||"title"===r)return!0})(u)&&{"aria-hidden":"true"},...u},[...m.map(e=>{let[r,t]=e;return(0,a.createElement)(r,t)}),...Array.isArray(c)?c:[c]])}),o=(e,r)=>{let t=(0,a.forwardRef)((t,l)=>{let{className:o,...d}=t;return(0,a.createElement)(i,{ref:l,iconNode:r,className:n("lucide-".concat(s(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),o),...d})});return t.displayName=s(e),t}},73127:(e,r,t)=>{function a(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function s(e){return e?e.length<3?{isValid:!1,error:"Slug must be at least 3 characters"}:e.startsWith("-")||e.endsWith("-")?{isValid:!1,error:"Slug cannot start or end with hyphens"}:e.includes("--")?{isValid:!1,error:"Slug cannot contain consecutive hyphens"}:/^[a-z0-9-]+$/.test(e)?{isValid:!0}:{isValid:!1,error:"Slug can only contain lowercase letters, numbers, and hyphens"}:{isValid:!1,error:"Slug is required"}}t.d(r,{Y:()=>a,g:()=>s})},90488:(e,r,t)=>{t.d(r,{A:()=>n});var a=t(95155);let s=(0,t(67909).default)(()=>Promise.all([t.e(9135),t.e(3965),t.e(2804),t.e(4909),t.e(511)]).then(t.bind(t,50511)).then(e=>({default:e.BlogEditButton})),{loadableGenerated:{webpack:()=>[50511]},ssr:!1,loading:()=>null});function n(e){let{blog:r,variant:t,className:n,isDraft:l=!1}=e;return(0,a.jsx)(s,{blog:r,variant:t,className:n,isDraft:l})}}}]);
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.