PageSourceSearch

https://www.mehdio.com/_next/static/chunks/app/layout-52082cee58193356.js

js mehdio.com collected 2026-09-25 20:22:28 UTC 12,133 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{2007:function(e,t,s){Promise.resolve().then(s.t.bind(s,231,23)),Promise.resolve().then(s.t.bind(s,4049,23)),Promise.resolve().then(s.t.bind(s,9325,23)),Promise.resolve().then(s.bind(s,5377)),Promise.resolve().then(s.bind(s,2650)),Promise.resolve().then(s.t.bind(s,1750,23))},5377:function(e,t,s){"use strict";s.d(t,{Header:function(){return Z}});var a=s(7437),r=s(2265),n=s(7138),l=s(6463),c=s(3611),i=s(5481),o=s(6009),d=s(7323),u=s(8241),x=s(7614),h=s(8801),m=s(967),p=s(5359),f=s(8359),b=s(7153),j=s(289),v=s(8813),g=s(3363),N=s(4583);function w(){let[e,t]=(0,r.useState)(!1),s=e=>{let{title:s,icon:r,...l}=e;return(0,a.jsxs)(n.default,{...l,onClick:()=>t(!1),className:"menu-item",children:[(0,a.jsx)(r,{size:"1em",weight:"duotone"}),(0,a.jsx)("span",{children:s})]})};return(0,a.jsxs)(u.fC,{open:e,onOpenChange:t,children:[(0,a.jsx)(u.xz,{asChild:!0,className:"md:hidden",children:(0,a.jsx)("button",{className:"px-4 py-3","aria-label":"Open menu",children:(0,a.jsx)(h.a,{size:"1em"})})}),(0,a.jsxs)(u.h_,{children:[(0,a.jsx)(u.aV,{className:"fixed inset-0 z-50 bg-black/40 backdrop-blur-md data-[state=open]:animate-overlayShow"}),(0,a.jsx)(u.VY,{className:"fixed bottom-0 right-0 top-0 z-50 w-3/4 data-[state=closed]:animate-slide-right data-[state=open]:animate-slide-left",children:(0,a.jsxs)("div",{className:"relative flex h-dvh w-full",children:[(0,a.jsx)(u.x8,{asChild:!0,className:"absolute left-2 top-2 rounded-full p-2 backdrop-blur-lg active:bg-red-300/10 active:text-red-400",children:(0,a.jsx)("button",{"aria-label":"Close",children:(0,a.jsx)(m.X,{size:"1em",weight:"bold"})})}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col overflow-y-scroll rounded-bl-[2rem] rounded-tl-[2rem] bg-neutral-950 py-10 text-xl",children:[(0,a.jsx)(s,{title:"Home",icon:p.T,href:"/"}),(0,a.jsx)(s,{title:"Blog",icon:f.j,href:"/blog"}),(0,a.jsx)(s,{title:"Videos",icon:b.n,href:"/videos"}),(0,a.jsx)(s,{title:"Projects",icon:j.a,href:"/projects"}),(0,a.jsx)(s,{title:"About",icon:v.n,href:"/about"}),(0,a.jsx)(s,{title:"Sitemap",icon:g.d,href:"/sitemap"}),(0,a.jsx)(e=>{let{title:t,icon:s,...r}=e;return(0,a.jsxs)("a",{...r,className:"menu-item",target:"_blank",children:[(0,a.jsx)(s,{size:"1em",weight:"duotone"}),(0,a.jsxs)("span",{className:"flex items-end gap-px",children:[(0,a.jsx)("span",{children:t}),(0,a.jsx)(x.G,{size:"1em",className:"text-xs"})]})]})},{title:"Github",icon:N.b,rel:"external",href:"https://github.com/mehd-io/mehdio-website"})]})]})})]})]})}s(9255);var y=s(8954),k=s(2023),_=s(6864),S=s(4817),C=s(3274),E=s(4697);function z(){let[e,t]=(0,r.useState)(!1),[s,n]=(0,r.useState)(""),l=(0,r.useRef)(null),c=(0,r.useRef)(null),{results:i,loading:o,search:d,clearResults:u}=function(){let{debounceMs:e=300}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,s]=(0,r.useState)([]),[a,n]=(0,r.useState)(!1),[l,c]=(0,r.useState)(null),[i,o]=(0,r.useState)(""),d=(0,r.useRef)(null),u=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{d.current&&d.current.abort(),u.current&&clearTimeout(u.current)},[]);let x=(0,r.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(d.current&&d.current.abort(),!e||e.trim().length<2){s([]),c(null);return}d.current=new AbortController,n(!0),c(null);try{var a;let r=new URLSearchParams({q:e.trim(),limit:(t.limit||20).toString(),offset:(t.offset||0).toString()});(null===(a=t.types)||void 0===a?void 0:a.length)&&r.set("types",t.types.join(","));let n=await fetch("/api/search?".concat(r),{signal:d.current.signal});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.details||"Search failed")}let l=await n.json();s(l.results)}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;console.error("Search error:",e),c(e instanceof Error?e.message:"Search failed. Please try again."),s([])}finally{n(!1)}},[]);return{results:t,loading:a,error:l,query:i,search:(0,r.useCallback)(function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(t),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{x(t,s)},e)},[x,e]),clearResults:(0,r.useCallback)(()=>{s([]),c(null),o(""),u.current&&clearTimeout(u.current),d.current&&d.current.abort()},[])}}({debounceMs:250});(0,r.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),t(!0),setTimeout(()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()},0)),"Escape"===e.key&&(t(!1),u(),n(""))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u]),(0,r.useEffect)(()=>{let e=e=>{c.current&&!c.current.contains(e.target)&&t(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let x=e=>{n(e),d(e,{limit:8})}
1,h=e=>{e.url&&window.open(e.url,"_blank","noopener,noreferrer"),t(!1),u(),n("")};return(0,a.jsxs)("div",{ref:c,className:"relative",children:[(0,a.jsxs)("button",{onClick:()=>{t(!0),setTimeout(()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()},0)},className:"flex items-center gap-2 rounded-lg border border-cap-navy/50 bg-neutral-900/50 px-3 py-1.5 text-sm text-cap-steel transition-all hover:border-cap-blue/50 hover:text-cap-ice",children:[(0,a.jsx)(S.Z,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Search"}),(0,a.jsx)("kbd",{className:"hidden rounded bg-neutral-800 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500 sm:inline",children:"⌘K"})]}),e&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),(0,a.jsx)("div",{className:"fixed left-1/2 top-24 z-50 w-full max-w-xl -translate-x-1/2 px-4 sm:px-0",children:(0,a.jsxs)("div",{className:"overflow-hidden rounded-xl border border-cap-navy/50 bg-neutral-950 shadow-2xl shadow-black/50",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 border-b border-cap-navy/30 px-4 py-3",children:[(0,a.jsx)(S.Z,{className:"h-5 w-5 text-cap-steel"}),(0,a.jsx)("input",{ref:l,type:"text",value:s,onChange:e=>x(e.target.value),placeholder:"Search videos, blog posts, articles...",className:"flex-1 bg-transparent text-base text-cap-ice placeholder-cap-steel/50 outline-none",autoComplete:"off"}),o&&(0,a.jsx)(C.Z,{className:"h-4 w-4 animate-spin text-blog-yellow"}),s&&!o&&(0,a.jsx)("button",{onClick:()=>{var e;n(""),u(),null===(e=l.current)||void 0===e||e.focus()},className:"rounded p-1 text-cap-steel transition-colors hover:bg-neutral-800 hover:text-cap-ice",children:(0,a.jsx)(E.Z,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:i.length>0?(0,a.jsx)("ul",{className:"py-2",children:i.map((e,t)=>(0,a.jsx)("li",{children:(0,a.jsxs)("button",{onClick:()=>h(e),className:"flex w-full items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-cap-navy/20",children:[(0,a.jsx)("div",{className:"mt-0.5 flex-shrink-0",children:function(e){switch(e){case"video":return(0,a.jsx)(y.Z,{className:"h-4 w-4 text-red-400"});case"blog_substack":return(0,a.jsx)(k.Z,{className:"h-4 w-4 text-blog-yellow"});case"blog_motherduck":return(0,a.jsx)(_.Z,{className:"h-4 w-4 text-blog-coral"});default:return(0,a.jsx)(k.Z,{className:"h-4 w-4 text-neutral-400"})}}(e.content_type)}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-neutral-400",children:function(e){switch(e){case"video":return"Video";
1case"blog_substack":return"Blog";case"blog_motherduck":return"Article";default:return"Content"}}(e.content_type)}),e.author&&(0,a.jsxs)("span",{className:"text-xs text-cap-steel/70",children:["by ",e.author]})]}),(0,a.jsx)("h4",{className:"mt-1 line-clamp-1 text-sm font-medium text-cap-ice",children:e.title}),e.snippet&&(0,a.jsx)("p",{className:"mt-1 line-clamp-2 text-xs text-cap-steel/70",dangerouslySetInnerHTML:{__html:e.snippet}})]})]})},"".concat(e.content_type,"-").concat(e.content_id,"-").concat(t)))}):s.length>=2&&!o?(0,a.jsxs)("div",{className:"px-4 py-8 text-center",children:[(0,a.jsxs)("p",{className:"text-sm text-cap-steel",children:['No results found for "',s,'"']}),(0,a.jsx)("p",{className:"mt-1 text-xs text-cap-steel/50",children:"Try different keywords"})]}):s?null:(0,a.jsxs)("div",{className:"px-4 py-6",children:[(0,a.jsx)("p",{className:"text-center text-sm text-cap-steel/70",children:"Start typing to search across all content"}),(0,a.jsx)("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:["duckdb","python","data engineering","analytics"].map(e=>(0,a.jsx)("button",{onClick:()=>x(e),className:"rounded-full border border-cap-navy/50 px-3 py-1 text-xs text-cap-steel transition-colors hover:border-blog-yellow/50 hover:text-blog-yellow",children:e},e))})]})}),(0,a.jsx)("div",{className:"border-t border-cap-navy/30 px-4 py-2",children:(0,a.jsx)("div",{className:"flex items-center justify-center text-[10px] text-cap-steel/50",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("kbd",{className:"rounded bg-neutral-800 px-1.5 py-0.5 font-mono",children:"↵"}),"to select"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("kbd",{className:"rounded bg-neutral-800 px-1.5 py-0.5 font-mono",children:"esc"}),"to close"]})]})})})]})})]})]})}let P=[{href:"https://youtube.com/@mehdio",icon:c.V,label:"YouTube"},{href:"https://github.com/mehd-io",icon:i.b,label:"GitHub"},{href:"https://www.linkedin.com/in/mehd-io/",icon:o.S,label:"LinkedIn"},{href:"https://x.com/@mehd_io",icon:d.S,label:"X"}],T=e=>{let{name:t,path:s}=e,r=(0,l.usePathname)(),c="/"===s?s===r:r.startsWith(s);return s.startsWith("http://")||s.startsWith("https://")?(0,a.jsx)("a",{href:s,className:"rounded-lg p-2 leading-none text-cap-steel transition-colors hover:bg-cap-blue/20 hover:text-cap-ice",target:"_blank",rel:"noopener noreferrer",children:t}):(0,a.jsx)(n.default,{href:s,"data-active":c,className:"rounded-lg p-2 leading-none text-cap-steel transition-colors data-[active='true']:bg-cap-blue/20 data-[active='true']:text-cap-ice hover:bg-cap-blue/20 hover:text-cap-ice",children:t})};function Z(){return(0,a.jsx)("header",{className:"fixed top-0 z-40 w-full p-3",children:(0,a.jsxs)("div",{className:"content-container m-auto flex items-center justify-between rounded-xl border border-cap-navy/50 bg-neutral-1000/85 p-0 shadow-sm backdrop-blur-3xl transition-all md:px-5",children:[(0,a.jsx)(n.default,{href:"/",className:"bg-gradient-to-r from-cap-ice to-cap-coral-light bg-clip-text px-4 py-3 font-handwrite text-2xl font-bold text-transparent drop-shadow-lg transition-all hover:from-cap-blue hover:to-cap-coral md:px-0",children:"Mehdi Ouazza"}),(0,a.jsxs)("div",{className:"hidden w-full items-center gap-6 md:flex md:w-auto",children:[(0,a.jsxs)("nav",{className:"flex-wrap items-center justify-center gap-5",children:[(0,a.jsx)(T,{name:"Home",path:"/"}),(0,a.jsx)(T,{name:"Blog",path:"/blog"}),(0,a.jsx)(T,{name:"Videos",path:"/videos"}),(0,a.jsx)(T,{name:"Projects",path:"/projects"}),(0,a.jsx)(T,{name:"About",path:"/about"})]}),(0,a.jsx)("div",{className:"flex items-center gap-3 border-l border-cap-navy/50 pl-4",children:P.map(e=>{let{href:t,icon:s,label:r}=e;return(0,a.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer","aria-label":r,className:"text-cap-steel/70 transition-colors hover:text-cap-ice",children:(0,a.jsx)(s,{className:"h-5 w-5",weight:"regular"})},r)})}),(0,a.jsx)(z,{})]}),(0,a.jsxs)("div",{className:"flex items-center md:hidden",children:[(0,a.jsx)(z,{}),(0,a.jsx)(w,{})]})]})})}},2650:function(e,t,s){"use strict";s.d(t,{Providers:function(){return n}});var a=s(7437),r=s(9512);function n(e){let{children:t}=e;return(0,a.jsx)(r.f,{attribute:"class",defaultTheme:"dark",forcedTheme:"dark",children:t})}},9255:function(){},1750:function(){}},function(e){e.O(0,[735,197,231,748,971,23,744],function(){return e(e.s=2007)}),_N_E=e.O()}]);

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.