1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardLayout-Cz_rX-5N.js","assets/rolldown-runtime-B0Z9INg1.js","assets/radix-DuU_8sUg.js","assets/hooks-DNh9Dh_n.js","assets/lib-6V1ZXuA0.js","assets/preload-helper-BZ1Pz5am.js","assets/AuthContext-DS2buoYO.js","assets/toast-CttmTrKz.js","assets/createLucideIcon-BOi0fTAK.js","assets/book-open-CmieJgnc.js","assets/gift-O6h-fKtL.js","assets/house-BDQeBsS_.js","assets/log-out-Dxn2VIH6.js","assets/command-Co1YBpKD.js","assets/message-square-BVIZT6Op.js","assets/search-DtlN3vnh.js","assets/utils-BUJUdpqn.js","assets/clsx-DB0hHKMi.js","assets/bundle-mjs-DxdGK6Xj.js","assets/api-CuDIABbL.js","assets/index-CXFrR_xA.js","assets/react-B-CAFwyM.js","assets/postAuthRoute-D-quDbfQ.js","assets/layout-dashboard-D9C6nnkk.js","assets/plus-ByJBBbt8.js","assets/user-BMT0YBJ2.js","assets/dist-vQKyhPpT.js","assets/useIsDesktop-CJw1sI1j.js","assets/useEscapeKey-notcxzIK.js","assets/dialog-CHlNRZMr.js","assets/index-BXzE3VNC.css","assets/AdminLayout-DvsJIbMJ.js","assets/activity-DrnZ-JZn.js","assets/chevron-right-QN2WO82Y.js","assets/clipboard-list-Bd5n_ITD.js","assets/external-link-BLWZc_-j.js","assets/list-BWjXx0oM.js","assets/store-CgwOJrFT.js","assets/ticket-CLibC4Fp.js","assets/wallet-DdKgBRn0.js","assets/AdminThemeContext-BSNMt-NZ.js"])))=>i.map(i=>d[i]); 2import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{C as t,T as n}from"./radix-DuU_8sUg.js";import{i as r,t as i}from"./lib-6V1ZXuA0.js";import{t as a}from"./preload-helper-BZ1Pz5am.js";import{n as o}from"./AuthContext-DS2buoYO.js";import{t as s}from"./utils-BUJUdpqn.js";import{Nt as c,S as l,_ as u,b as d,d as f,g as p,u as m}from"./index-CXFrR_xA.js";import{r as h,t as g}from"./blogCategories-DQfTwC8J.js";import{t as _}from"./CrawlablePagination-BuBVySzF.js";var v=e(n(),1),y=t(),b=(0,v.lazy)(()=>a(()=>import(`./DashboardLayout-Cz_rX-5N.js`).then(e=>({default:e.DashboardLayout})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]))),x=(0,v.lazy)(()=>a(()=>import(`./AdminLayout-DvsJIbMJ.js`).then(e=>({default:e.AdminLayout})),__vite__mapDeps([31,1,2,3,4,5,6,7,8,32,9,33,34,35,10,11,23,36,12,13,14,15,16,17,18,19,20,21,22,24,25,26,27,28,29,37,38,39,40,30]))),S=[`Tous`,`Naissance`,`Mariage`,`Anniversaire`,`Noël`,`Saint-Valentin`,`Crémaillère`,`Entreprise`,`Vie quotidienne`,`Conseils`],C=6;function w(e){return new Date(e).toLocaleDateString(`fr-FR`,{day:`numeric`,month:`long`,year:`numeric`})}function T(e){let t=Math.floor((Date.now()-new Date(e).getTime())/864e5);return t<=0?`aujourd'hui`:t===1?`hier`:t<7?`il y a ${t} j`:t<30?`il y a ${Math.floor(t/7)} sem.`:t<365?`il y a ${Math.floor(t/30)} mois`:w(e)}function E(){return(0,y.jsxs)(`div`,{className:`animate-pulse`,children:[(0,y.jsx)(`div`,{className:`aspect-[16/10] rounded-[14px] bg-[#F3F0EB] mb-3`}),(0,y.jsx)(`div`,{className:`h-3 bg-[#F3F0EB] rounded w-1/4 mb-2`}),(0,y.jsx)(`div`,{className:`h-5 bg-[#F3F0EB] rounded w-4/5 mb-2`}),(0,y.jsx)(`div`,{className:`h-4 bg-[#F3F0EB] rounded w-full mb-1`}),(0,y.jsx)(`div`,{className:`h-4 bg-[#F3F0EB] rounded w-2/3`})]})}function D(){return(0,y.jsxs)(`div`,{className:`grid md:grid-cols-[1.4fr_1fr] gap-6 animate-pulse`,children:[(0,y.jsx)(`div`,{className:`aspect-[5/4] rounded-[18px] bg-[#F3F0EB]`}),(0,y.jsxs)(`div`,{className:`flex flex-col justify-center gap-3`,children:[(0,y.jsx)(`div`,{className:`h-3 bg-[#F3F0EB] rounded w-1/3`}),(0,y.jsx)(`div`,{className:`h-7 bg-[#F3F0EB] rounded w-4/5`}),(0,y.jsx)(`div`,{className:`h-4 bg-[#F3F0EB] rounded w-full`}),(0,y.jsx)(`div`,{className:`h-4 bg-[#F3F0EB] rounded w-2/3`}),(0,y.jsx)(`div`,{className:`h-3 bg-[#F3F0EB] rounded w-1/2`})]})]})}function O({article:e}){let t=g[e.category]??`#DB2777`;return(0,y.jsxs)(`article`,{className:`grid md:grid-cols-[1.4fr_1fr] gap-6 md:gap-10 items-center`,children:[(0,y.jsx)(i,{to:`/blog/${e.slug}`,className:`block group relative`,children:(0,y.jsxs)(`div`,{className:`aspect-[5/4] rounded-[18px] overflow-hidden bg-[#FCE7F3] relative`,children:[(0,y.jsx)(`img`,{src:e.coverImage,srcSet:f(e.coverImage),sizes:`(max-width: 768px) 100vw, 60vw`,alt:e.title,loading:`lazy`,decoding:`async`,className:`w-full h-full object-cover group-hover:scale-[1.02] transition-transform duration-700`}),(0,y.jsx)(`span`,{className:`absolute top-4 left-4 bg-[#1f2937] text-white text-[10px] font-semibold uppercase tracking-[0.08em] px-3 py-1 rounded-full`,children:`à la une`})]})}),(0,y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,y.jsxs)(i,{to:`/blog/${e.slug}`,className:`group`,children:[(0,y.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.12em] mb-2`,style:{color:t},children:e.category}),(0,y.jsx)(`h2`,{className:`font-[var(--font-serif-display)] text-[26px] md:text-[28px] text-[#1f2937] leading-[1.1] mb-3 group-hover:opacity-80 transition-opacity`,children:e.title})]}),(0,y.jsx)(`p`,{className:`text-[13px] text-[#6b7280] leading-[1.6] mb-4 line-clamp-3`,children:e.excerpt}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-[#6b7280] mb-4`,children:[(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,y.jsx)(`span`,{"aria-hidden":!0,
2className:`inline-block w-5 h-5 rounded-full`,style:{background:`linear-gradient(135deg, ${t}, #A78BFA)`}}),`Kadelio`]}),(0,y.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,y.jsxs)(`span`,{children:[e.readingTime,` min de lecture`]}),(0,y.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,y.jsx)(`span`,{children:T(e.publishedAt)})]}),(0,y.jsx)(i,{to:`/blog/${e.slug}`,className:`self-start inline-flex items-center gap-1.5 text-[13px] font-semibold pb-[2px] border-b transition-colors`,style:{color:t,borderColor:t},children:`Lire l'article â`})]})]})}function k({article:e,index:t}){let n=g[e.category]??`#DB2777`,r=h[e.category]??`linear-gradient(135deg, #FCE7F3, #DB2777)`;return(0,y.jsx)(d.article,{layout:!0,initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,scale:.97},transition:{duration:.3,delay:Math.min(t*.035,.24)},className:`group`,children:(0,y.jsxs)(i,{to:`/blog/${e.slug}`,className:`block`,children:[(0,y.jsx)(`div`,{className:`aspect-[16/10] rounded-[14px] overflow-hidden mb-3 bg-[#F3F0EB]`,style:{background:r},children:e.coverImage&&(0,y.jsx)(`img`,{src:e.coverImage,srcSet:f(e.coverImage),sizes:`(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw`,alt:e.title,loading:`lazy`,decoding:`async`,className:`w-full h-full object-cover group-hover:scale-[1.03] transition-transform duration-500`})}),(0,y.jsx)(`p`,{className:`text-[10px] font-semibold uppercase tracking-[0.08em] mb-1`,style:{color:n},children:e.category}),(0,y.jsx)(`h3`,{className:`font-[var(--font-serif-display)] text-[18px] text-[#1f2937] leading-[1.2] mb-1 line-clamp-2 group-hover:opacity-80 transition-opacity`,children:e.title}),(0,y.jsx)(`p`,{className:`text-[12px] text-[#6b7280] leading-[1.45] line-clamp-2 mb-2`,children:e.excerpt}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-[#6b7280]`,children:[(0,y.jsxs)(`span`,{children:[e.readingTime,` min`]}),(0,y.jsx)(`span`,{"aria-hidden":!0,className:`w-[2px] h-[2px] rounded-full bg-[#6b7280]`}),(0,y.jsx)(`span`,{children:T(e.publishedAt)})]})]})})}function A({isAuthenticated:e,featured:t,articles:n,loading:r,activeCategory:i,onChangeCategory:a,page:o,totalPages:c,showFeatured:u}){let f=e?`Le journal des Kadéliens`:`Le journal Kadelio`,p=e?`Le Blog`:`Inspirations pour vos plus belles occasions`,m=e?`Conseils, inspirations et histoires de famille pour faire de chaque liste un moment qu'on n'oublie pas.`:`Conseils, histoires de famille, idées cadeaux. Tout ce qu'il faut pour transformer une simple liste en moment mémorable.`;return(0,y.jsxs)(`div`,{className:`bg-white rounded-2xl border border-[#E8EDE4] overflow-hidden`,children:[(0,y.jsxs)(`header`,{className:`px-7 md:px-10 pt-8 md:pt-10 pb-5 border-b border-[#E8EDE4]`,children:[(0,y.jsx)(d.p,{initial:{opacity:0,y:-6},animate:{opacity:1,y:0},className:`text-[10px] uppercase tracking-[0.14em] text-[#DB2777] font-semibold mb-2`,children:f}),(0,y.jsx)(d.h1,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.05},className:`font-[var(--font-serif-display)] text-[30px] md:text-[38px] text-[#1f2937] leading-[1.05] mb-2`,children:p}),(0,y.jsx)(d.p,{initial:{opacity:0}
2,animate:{opacity:1},transition:{delay:.12},className:`text-[13px] text-[#6b7280] leading-[1.55] max-w-[60ch]`,children:m})]}),(0,y.jsx)(`div`,{"data-testid":`blog-categories`,className:s(`sticky z-20 bg-white border-b border-[#E8EDE4]`,e?`top-0`:`top-20`),children:(0,y.jsx)(`div`,{className:`px-7 md:px-10 py-3 flex gap-2 overflow-x-auto scrollbar-none`,children:S.map(e=>{let t=i===e||e===`Tous`&&i===`Tous`,n=e===`Tous`?`Tout`:e;return(0,y.jsx)(`button`,{onClick:()=>a(e),"aria-pressed":t,className:s(`shrink-0 px-3 py-[5px] rounded-full text-[11px] font-medium transition-colors whitespace-nowrap`,t?`bg-[#1f2937] text-white`:`bg-[#FAF7F2] text-[#6b7280] hover:text-[#1f2937]`),children:n},e)})})}),(0,y.jsx)(`div`,{className:`px-7 md:px-10 py-7 md:py-9`,children:r?(0,y.jsxs)(`div`,{className:`space-y-10`,children:[o===1&&(0,y.jsx)(D,{}),(0,y.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-7 gap-y-9`,children:Array.from({length:C}).map((e,t)=>(0,y.jsx)(E,{},t))})]}):n.length===0&&!u?(0,y.jsxs)(`div`,{className:`py-20 text-center`,children:[(0,y.jsx)(`p`,{className:`text-[14px] text-[#6b7280] mb-3`,children:`Aucun article dans cette catégorie pour l'instant.`}),(0,y.jsx)(`button`,{onClick:()=>a(`Tous`),className:`text-[13px] text-[#DB2777] font-semibold hover:underline`,children:`Voir tous les articles`})]}):(0,y.jsxs)(`div`,{className:`space-y-10`,children:[u&&t&&(0,y.jsx)(`section`,{"data-testid":`blog-featured`,className:`pb-8 border-b border-[#E8EDE4]`,children:(0,y.jsx)(O,{article:t})}),n.length>0&&(0,y.jsx)(d.div,{layout:!0,className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-7 gap-y-9`,children:(0,y.jsx)(l,{children:n.map((e,t)=>(0,y.jsx)(k,{article:e,index:t},e.slug))})}),c>1&&(0,y.jsx)(_,{page:o,totalPages:c,makeHref:e=>e<=1?`/blog`:`/blog?page=${e}`})]})})]})}function j(){let{user:e}=o(),t=!!e,[n,i]=r(),a=Math.max(1,Number(n.get(`page`))||1),[s,l]=(0,v.useState)(null),[d,f]=(0,v.useState)([]),[h,g]=(0,v.useState)(1),[_,S]=(0,v.useState)(!0),[w,T]=(0,v.useState)(`Tous`);(0,v.useEffect)(()=>{fetch(`/api/blog/featured`).then(e=>e.ok?e.json():null).then(e=>l(e)).catch(()=>l(null))},[]),(0,v.useEffect)(()=>{let e=!1;S(!0);let t=new URL(`/api/blog`,window.location.origin);return w!==`Tous`&&t.searchParams.set(`category`,w),t.searchParams.set(`limit`,String(C)),t.searchParams.set(`page`,String(a)),fetch(t.toString()).then(e=>e.json()).then(t=>{e||(f(t.posts),g(t.totalPages))}).catch(()=>{e||(f([]),g(1))}).finally(()=>{e||S(!1)}),()=>{e=!0}},[w,a]);function E(e){T(e),i({},{replace:!0})}let D=!!s&&(w===`Tous`||s.category===w),O=a>1?`https://kadelio.com/blog?page=${a}`:`https://kadelio.com/blog`,k=`Blog Kadelio - Conseils pour listes de cadeaux`,j=a>1?`${k} - Page ${a}`:k,N=(0,y.jsxs)(c,{children:[(0,y.jsx)(`title`,{children:j}),(0,y.jsx)(`meta`,{name:`description`,content:`Découvrez nos conseils pour créer la liste de cadeaux parfaite : naissance, mariage, anniversaire, Noël. Guides pratiques et idées originales.`}),(0,y.jsx)(`meta`,{property:`og:title`,content:j}),(0,y.jsx)(`meta`,{property:`og:description`,content:`Guides pratiques, idées et conseils pour créer votre liste de cadeaux parfaite.`}),(0,y.jsx)(`meta`,{property:`og:type`,content:`website`}),(0,y.jsx)(`link`,{rel:`canonical`,href:O}),(0,y.jsx)(`meta`,{property:`og:url`,content:O}),(0,y.jsx)(`meta`,{property:`og:image`,content:`https://kadelio.com/og-image.png`}),(0,y.jsx)(`meta`,{property:`og:locale`,content:`fr_FR`}),(0,y.jsx)(`meta`,{name:`twitter:card`,content:`summary_large_image`}),(0,y.jsx)(`meta`,{name:`twitter:image`,content:`https://kadelio.com/og-image.png`}),(0,y.jsx)(`meta`,{name:`twitter:title`,content:j}),(0,y.jsx)(`meta`,{name:`twitter:description`,content:`Guides pratiques, idées et conseils pour créer votre liste de cadeaux parfaite.`})]}),P=(0,y.jsx)(A,{isAuthenticated:t,featured:s,articles:d,loading:_,activeCategory:w,onChangeCategory:E,page:a,totalPages:h,showFeatured:D});if(t){let t=e.role===`ADMIN`?x:b;return(0,y.jsxs)(y.Fragment,{children:[N,(0,y.jsx)(v.Suspense,{fallback:(0,y.jsx)(`div`,{className:`min-h-screen bg-[#FDFBF7]`}),children:(0,y.jsx)(t,{children:P})})]})}return(0,y.jsxs)(`div`,{className:`min-h-screen bg-[#FAF7F2] font-sans`,children:[N,(0,y.jsx)(u,{}),(0,y.jsx)(`main`,{className:`pt-20 max-w-6xl mx-auto px-4 py-8 md:py-12`,children:P}),(0,y.jsx)(`div`,{className:`max-w-6xl mx-auto px-4 pb-16`,children:(0,y.jsx)(M,{})}),(0,y.jsx)(m,{}),(0,y.jsx)(p,{})]})}function M(){return(0,y.jsxs)(`div`,{className:`relative overflow-hidden bg-white border border-[#
2E8EDE4] rounded-2xl px-8 py-10 text-center`,children:[(0,y.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.14em] text-[#DB2777] font-semibold mb-2`,children:`Et vous, par où on commence ?`}),(0,y.jsx)(`h2`,{className:`font-[var(--font-serif-display)] text-[26px] text-[#1f2937] mb-2`,children:`Prêt à créer votre liste ?`}),(0,y.jsx)(`p`,{className:`text-[13px] text-[#6b7280] mb-6`,children:`Gratuit, sans pub, sans commission. Partageable en un clic.`}),(0,y.jsx)(i,{to:`/register`,className:`inline-flex items-center gap-2 px-6 py-3 rounded-xl text-white text-[13px] font-semibold bg-[linear-gradient(135deg,#DB2777,#A78BFA)] hover:shadow-[0_6px_16px_rgba(219,39,119,0.3)] transition-all`,children:`Créer ma liste gratuitement â`})]})}export{j as Blog}; 3//# sourceMappingURL=Blog-D7e20KHR.js.map
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.