1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,408486,e=>{"use strict";var r=e.i(843476),t=e.i(657688),a=e.i(236648),l=e.i(456904),s=e.i(621383),i=e.i(271645),n=e.i(880799),o=e.i(618566),c=e.i(368694),d=e.i(861745),h=e.i(948148),g=e.i(62870),x=e.i(160889),u=e.i(334541);let m=[{id:"all",icon:null},{id:"developers",icon:"programming-linear"},{id:"entrepreneurs",icon:"case-minimalistic-linear"},{id:"nocode",icon:"bolt-linear"}];function f({category:e,onCategoryChange:t}){let a=(0,h.useTranslations)();return(0,r.jsx)("div",{className:"flex gap-2 flex-wrap",children:m.map(l=>{let s=e===l.id||!e&&"all"===l.id;return(0,r.jsxs)("button",{onClick:()=>t(l.id),className:` 2 flex items-center gap-2 px-4 py-2.5 rounded-xl font-medium text-sm 3 transition-all duration-200 whitespace-nowrap 4 ${s?"bg-primary text-white shadow-md shadow-primary/25":"bg-gray-100 dark:bg-grayDark-800 text-gray-700 dark:text-grayDark-300 hover:bg-gray-200 dark:hover:bg-grayDark-700"} 5 `,children:[l.icon&&(0,r.jsx)(u.default,{name:l.icon,className:"w-4 h-4"}),(0,r.jsx)("span",{children:a(`courses_category_${l.id}`)})]},l.id)})})}var p=e.i(217255),b=e.i(736912);e.s(["default",0,function({initialArticles:e=null,initialTotal:u=null}){let{data:m}=(0,p.useSession)(),y=(0,d.useLocale)(),k=(0,o.useSearchParams)(),v=(0,i.useRef)(null),j=(0,l.useRouter)(),w=(0,h.useTranslations)(),N=m?.user?.timezone||n.default.tz.guess(),[S,$]=(0,i.useState)(e||[]),[D,C]=(0,i.useState)(e||[]),[L,T]=(0,i.useState)(null),[z,P]=(0,i.useState)("all"),[_,B]=(0,i.useState)(u),[O,I]=(0,i.useState)(!1),[A,E]=(0,i.useState)(!!e),[F,R]=(0,i.useState)(!1),[M,J]=(0,i.useState)(new Set),U=async(e=null,r=null)=>{if(O)return;I(!0);let t=1;t=e||V();let a=r||H(),l=await fetch("/api/articles/post/articles-with-pagination",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:t,max:15,categories:[a],locale:y})}),s=await l.json();$(s.articles),C(s.articles),B(parseInt(s.total)),A&&v.current?.scrollIntoView({behavior:"smooth",block:"start"}),E(!0),I(!1)},V=()=>{let e=k.get("page")||1;return e!=L&&T(parseInt(e)),parseInt(e)},H=()=>{let e=k.get("category")||"all";return P(e),e};return(0,i.useEffect)(()=>{A&&(V(),U())},[k]),(0,i.useEffect)(()=>{let r=parseInt(k.get("page")||1),t=k.get("category")||"all";if(e&&1===r&&"all"===t){T(1),P("all"),E(!0);return}V(),U()},[]),(0,i.useEffect)(()=>{m&&(async()=>{try{let e=await fetch("/api/article/bookmarked-ids",{method:"POST",headers:{"Content-Type":"application/json"}});if(e.ok){let r=await e.json();J(new Set(r.articleIds))}}catch(e){}})()},[m]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("section",{className:"flex gap-10 items-center mb-3",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"md:text-4xl text-3xl dark:text-white font-bold font-sourceSans pt-5",children:w("articles_title")}),(0,r.jsx)("div",{className:"text-lg text-[#05060F] text-opacity-70 dark:text-textSecondDark mt-4",ref:v,children:w("articles_headline")})]})}),(0,r.jsxs)("section",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mt-6 mb-8",children:[(0,r.jsx)(f,{category:z,onCategoryChange:e=>{"all"===e?(T(1),P("all"),U(1,"all")):(T(1),P(e),U(1,e)),"all"===e?j.push("/articles",void 0,{shallow:!0}):j.push(`/articles?category=${e}`,void 0,{shallow:!0})}}),(0,r.jsxs)(g.Select,{onValueChange:e=>window.open(e,"_blank"),children:[(0,r.jsx)(g.SelectTrigger,{className:"w-[180px]",children:(0,r.jsx)(g.SelectValue,{placeholder:w("articles_feeds_select")})}),(0,r.jsx)(g.SelectContent,{className:"dark:bg-bgDark-840 dark:border-borderDark",children:x.labels.map(e=>(0,r.jsx)(g.SelectItem,{value:`/feeds/articles-${e.id}.xml`,children:e.label},e.id))})]})]}),(0,r.jsx)("hr",{className:"mb-8 dark:border-borderDark"}),(0,r.jsx)("section",{className:"flex flex-col gap-5",children:A&&!O?(0,r.jsxs)(r.Fragment,{children:[0!=D.length&&F&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(c.default,{children:w("articles_languageNotSupportedYet")})}),0==D.length&&(0,r.jsx)(c.default,{children:w("articles_noArticles")}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-5",children:D.map(e=>(0,r.jsxs)("div",{className:"h-full relative",children:[m&&(0,r.jsx)("div",{className:"absolute top-2 right-2 z-20",children:(0,r.jsx)(b.default,{articleId:e.id,initialBookmarked:M.has(e.id),size:"small"})}),(0,r.jsx)(l.Link,{href:`/r/${e.slug}`,className:"h-full",children:(0,r.jsxs)("div",{className:"border border-gray-200 dark:border-borderDark bg-white dark:bg-bgDark-840 rounded-xl overflow-hidden group hover:bg-gray-50 dark:hover:bg-bgDark hover:border-primary dark:hover:border-primary transition-all duration-200 h-full flex flex-col",children:[(0,r.jsx)("div",{className:"aspect-[16/9] relative",children:(0,a.articleCoverPath)(e,y)?(0,r.jsx)(t.default,{src:(0,a.articleCoverPath)(e,y),alt:e.title,fill:!0,unoptimized:!e.cover,className:"object-cover"}):(0,r.jsx)("div",{className:"bg-primary/10 dark:bg-primary/20 w-full h-full"})}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col p-5",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"text-lg font-bold text-gray-900 dark:text-white group-hover:text-primary font-sourceSans line-clamp-2",children:e.title}),(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-grayDark-400 font-geistSans mt-2 line-clamp-3 mb-0",children:e.description})]}),(0,r.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-grayDark-400",children:(0,n.default)(e.dateCreation).tz(N).locale(y).format("LL")}),F&&(0,r.jsx)(s.default,{type:"red",children:w("courses_courseNotInYourLanguage")})]})]})]})})]},`article-${e.id}`))}),0!=D.length&&(0,r.jsx)("div",{className:"flex justify-center items-center pt-5",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[1!=L&&(0,r.jsx)(l.Link,{href:`/articles?page=${L-1}&category=${z}`,className:"flex items-center justify-center w-9 h-9 rounded-full bg-primary text-white hover:bg-primary-300 hover:text-white",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{fill:"currentColor",d:"m8.165 11.63l6.63-6.43C15.21 4.799 16 5.042 16 5.57v12.86c0 .528-.79.771-1.205.37l-6.63-6.43a.499.499 0 0 1 0-.74Z"})})}),L-4>0&&(0,r.jsx)(l.Link,{href:`/articles?page=${L-4}&category=${z}`,className:"flex items-center justify-center w-9 h-9 rounded-full bg-primary text-white hover:bg-primary-300 hover:text-white",children:L-4}),L-3>0&&(0,r.jsx)(l.Link,{href:`/articles?page=${L-3}&category=${z}`,className:"flex items-center justify-center w-9 h-9 rounded-full bg-primary text-white hover:bg-primary-300 hover:text-white",children:L-3}),L-2>0&&(0,r.jsx)(l.Link,{href:`/articles?page=${L-2}&category=${z}`,className:"flex items-center justify-center w-9 h-9 rounded-full bg-primary text-white hover:bg-primary-300 hover:text-white",children:L-2}),L-1>0&&(0,r.jsx)(l.Link,{href:`/articles?page=${L-1}&category=${z}`,className:"flex items-center justify-center w-9 h-9 rounded-full bg-primary text-white hover:bg-primary-300 hover:text-white",children:L-1}),(0,r.jsx)("div",{className:"flex items-center justify-center w-9 h-9 rounded-full bg-primary-300 text-white",children:L}),L+1<=_&&(0,r.jsx)(l.Link,{href:`/articles?page=${L+1}&category=${z}`,className:"flex items-center justify-center w-9 h-9 rounded-full bg-primary text-white hover:bg-primary-300 hover:text-white",children:L+1}),L+2<=_&&(0,r.jsx)(l.Link,{href:`/articles?page=${L+2}&category=${z}`,className:"flex items-center justify-center w-9 h-9 rounded-full bg-primary text-white hover:bg-primary-300 hover:text-white",children:L+2}),L+3<=_&&(0,r.jsx)(l.Link,{href:`/articles?page=${L+3}&category=${z}`,className:"flex items-center justify-center w-9 h-9 rounded-full bg-primary text-white hover:bg-primary-300 hover:text-white",children:L+3}),L+4<=_&&(0,r.jsx)(l.Link,{href:`/articles?page=${L+4}&category=${z}`,className:"flex items-center justify-center w-9 h-9 rounded-full bg-primary text-white hover:bg-primary-300 hover:text-white",children:L+4}),L!=_&&(0,r.jsx)(l.Link,{href:`/articles?page=${L+1}&category=${z}`,className:"flex items-center justify-center w-9 h-9 rounded-full bg-primary text-white hover:bg-primary-300 hover:text-white",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{fill:"currentColor",d:"M15.835 11.63L9.205 5.2C8.79 4.799 8 5.042 8 5.57v12.86c0 .528.79.771 1.205.37l6.63-6.43a.498.498 0 0 0 0-.74Z"})})})]})})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-5",children:Array.from({length:6}).map((e,t)=>(0,r.jsxs)("div",{className:"relative border border-gray-200 dark:border-bgDark-300 bg-white dark:bg-bgDark-840 rounded-xl overflow-hidden h-full flex flex-col",children:[(0,r.jsx)("div",{className:"aspect-[16/9] bg-gray-200 dark:bg-bgDark-300 animate-pulse relative",children:(0,r.jsx)("div",{className:"absolute top-2 right-2 z-20 w-8 h-8 rounded-full bg-white/90 dark:bg-bgDark-840/90 backdrop-blur-sm flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-4 h-4 rounded bg-gray-300 dark:bg-bgDark-300"})})}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col p-5 gap-3 bg-white dark:bg-bgDark-840",children:[(0,r.jsxs)("div",{className:"flex-1 space-y-2.5",children:[(0,r.jsx)("div",{className:"h-5 w-full rounded bg-gray-200 dark:bg-bgDark-300 animate-pulse"}),(0,r.jsx)("div",{className:"h-5 w-4/5 rounded bg-gray-200 dark:bg-bgDark-300 animate-pulse"}),(0,r.jsxs)("div",{className:"pt-1.5 space-y-2",children:[(0,r.jsx)("div",{className:"h-3.5 w-full rounded bg-gray-100 dark:bg-bgDark-300/50 animate-pulse"}),(0,r.jsx)("div",{className:"h-3.5 w-11/12 rounded bg-gray-100 dark:bg-bgDark-300/50 animate-pulse"}),(0,r.jsx)("div",{className:"h-3.5 w-2/3 rounded bg-gray-100 dark:bg-bgDark-300/50 animate-pulse"})]})]}),(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsx)("div",{className:"h-3 w-28 rounded bg-gray-100 dark:bg-bgDark-300/50 animate-pulse"})})]})]},`s-${t}`))})})]})}],408486)},368694,e=>{"use strict";var r=e.i(843476);e.s(["default",0,function({children:e,className:t=""}){return(0,r.jsx)("div",{className:`bg-bgLight dark:bg-bgDark-300 p-5 rounded-xl mb-5 ${t}`,children:(0,r.jsxs)("div",{className:"text-[#05060F] text-opacity-70 dark:text-lightBlue flex gap-4 items-center",children:[(0,r.jsx)("div",{children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5 text-blue-500",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{fill:"currentColor",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10",opacity:".5"}
5),(0,r.jsx)("path",{fill:"currentColor",d:"M12 17.75a.75.75 0 0 0 .75-.75v-6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75M12 7a1 1 0 1 1 0 2a1 1 0 0 1 0-2"})]})}),e]})})}])},736912,e=>{"use strict";var r=e.i(843476),t=e.i(271645),a=e.i(217255),l=e.i(948148),s=e.i(334541);e.s(["default",0,function({articleId:e,initialBookmarked:i,size:n="default",showSeparator:o=!1,onToggle:c}){let{data:d}=(0,a.useSession)(),h=(0,l.useTranslations)(),[g,x]=(0,t.useState)(i??!1),[u,m]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{void 0===i&&d&&e&&(async()=>{try{let r=await fetch("/api/article/is-bookmarked",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({articleId:e})});if(r.ok){let e=await r.json();x(e.isBookmarked)}}catch(e){}})()},[d,e,i]),(0,t.useEffect)(()=>{void 0!==i&&x(i)},[i]),!d)return null;let f=async r=>{if(r.preventDefault(),r.stopPropagation(),!u){m(!0),x(!g);try{let r=await fetch("/api/article/bookmark",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({articleId:e})});if(r.ok){let e=await r.json();x(e.isBookmarked),c&&c(e.isBookmarked)}else x(g)}catch(e){x(g)}finally{m(!1)}}};return(0,r.jsxs)(r.Fragment,{children:[o&&(0,r.jsx)("span",{className:"text-gray-300 dark:text-grayDark-600",children:"â¢"}),(0,r.jsx)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation()},onMouseDown:e=>e.stopPropagation(),children:(0,r.jsx)("button",{onClick:f,className:`${"small"===n?"w-8 h-8":"w-9 h-9"} flex items-center justify-center rounded-full transition-all duration-200 ${g?"bg-primary/10 text-primary hover:bg-primary/20":"bg-gray-100 dark:bg-grayDark-800 text-gray-500 dark:text-grayDark-400 hover:bg-gray-200 dark:hover:bg-grayDark-700 hover:text-gray-700 dark:hover:text-grayDark-300"} ${u?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,disabled:u,title:h(g?"bookmark_remove":"bookmark_add"),"aria-label":h(g?"bookmark_remove":"bookmark_add"),children:(0,r.jsx)(s.default,{name:g?"bookmark-bold":"bookmark-linear",className:"small"===n?"text-[16px]":"text-[18px]"})})})]})}])},621383,e=>{"use strict";var r=e.i(843476);e.s(["default",0,function({type:e,children:t}){return"green"==e?(0,r.jsx)("span",{className:"text-green-500 dark:text-green-400 bg-green-500/10 rounded-full px-3 py-1 text-sm",children:t}):"yellow"==e?(0,r.jsx)("span",{className:"text-yellow-500 dark:text-yellow-400 bg-yellow-500/10 rounded-full px-3 py-1 text-sm",children:t}):"blue"==e?(0,r.jsx)("span",{className:"text-blue-500 dark:text-blue-400 bg-blue-500/10 rounded-full px-3 py-1 text-sm",children:t}):"gray"==e?(0,r.jsx)("span",{className:"text-gray-500 dark:text-grayDark-400 bg-gray-500/10 rounded-full px-3 py-1 text-sm",children:t}):(0,r.jsx)("span",{className:"text-red-500 dark:text-red-400 bg-red-500/10 rounded-full px-3 py-1 text-sm",children:t})}])},236648,e=>{"use strict";e.s(["articleCoverPath",0,function(e,r="fr"){let t=(e?.cover||"").trim();if(t)return t;let a=e?.slug;if(!a)return"";let l=Number(e?.thumbnailSettings?.maj)||0,s=l?`&v=${l}`:"";return`/api/thumbnail/article?slug=${encodeURIComponent(a)}&locale=${"en"===r?"en":"fr"}${s}`}])},635804,e=>{"use strict";var r=e.i(271645),t=e.i(934620);function a(e){let[a,l]=r.useState(void 0);return(0,t.useLayoutEffect)(()=>{if(e){l({width:e.offsetWidth,height:e.offsetHeight});let r=new ResizeObserver(r=>{let t,a;if(!Array.isArray(r)||!r.length)return;let s=r[0];if("borderBoxSize"in s){let e=s.borderBoxSize,r=Array.isArray(e)?e[0]:e;t=r.inlineSize,a=r.blockSize}else t=e.offsetWidth,a=e.offsetHeight;l({width:t,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}l(void 0)},[e]),a}(0,Object.defineProperty)(a,"name",{value:"useSize",configurable:!0}),e.s(["useSize",0,a])}]); 6 7//# sourceMappingURL=44y17g0ly-3zx.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.