1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5823],{8324:function(e,r,t){"use strict";t.d(r,{Z:function(){return s}});var a=t(3769);let s=(0,a.Z)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},6905:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/writing",function(){return t(52)}])},52:function(e,r,t){"use strict";t.r(r),t.d(r,{__N_SSG:function(){return k},default:function(){return Writing}});var a=t(7708),s=t(2705),o=t.n(s),n=t(9700),l=t(9819),i=t(4811),p=t(7907),c=t(9353),d=t(9934),u=t(8574),x=t(8324),f=t(3455),h=t(3571);function parseQueryParam(e){var r;return Array.isArray(e)?null!==(r=e[0])&&void 0!==r?r:"":null!=e?e:""}let PostExplorer=e=>{let{posts:r}=e,t=(0,u.useRouter)(),[s,o]=(0,n.useState)(""),[l,i]=(0,n.useState)(""),[p,c]=(0,n.useState)(new Set),[d,m]=(0,n.useState)(1),g=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!t.isReady||g.current)return;g.current=!0;let e=parseQueryParam(t.query.q),r=function(e){let r=parseQueryParam(e);return r?new Set(r.split(",").filter(Boolean)):new Set}(t.query.tag),a=parseInt(parseQueryParam(t.query.page),10);o(e),i(e),c(r),Number.isFinite(a)&&a>0&&m(a)},[t.isReady,t.query.q,t.query.tag,t.query.page]),(0,n.useEffect)(()=>{let e=setTimeout(()=>i(s),200);return()=>clearTimeout(e)},[s]),(0,n.useEffect)(()=>{if(!t.isReady||!g.current)return;let e={};l.trim()&&(e.q=l.trim()),p.size>0&&(e.tag=Array.from(p).join(",")),d>1&&(e.page=String(d)),t.replace({pathname:"/writing",query:e},void 0,{shallow:!0})},[l,p,d]),(0,n.useEffect)(()=>{m(1)},[l,p]);let b=(0,n.useMemo)(()=>{let e=new Map;for(let t of r)for(let r of t.tags){let t=e.get(r.slug);t?t.count+=1:e.set(r.slug,{slug:r.slug,name:r.name,count:1})}return Array.from(e.values()).sort((e,r)=>e.name.localeCompare(r.name))},[r]),k=(0,n.useMemo)(()=>r.filter(e=>(function(e,r){if(!r.trim())return!0;let t=r.trim().toLowerCase(),a=[e.title,e.brief,...e.tags.map(e=>e.name)].join(" ").toLowerCase();return a.includes(t)})(e,l)&&(0===p.size||e.tags.some(e=>p.has(e.slug)))),[r,l,p]),y=Math.max(1,Math.ceil(k.length/6)),j=Math.min(d,y),v=k.slice((j-1)*6,6*j),toggleTag=e=>{c(r=>{let t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t})},w=""!==l.trim()||p.size>0;return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(x.Z,{size:16,className:"pointer-events-none absolute left-3.5 top-1/2 -translate-y-1/2 text-paper-400"}),(0,a.jsx)("input",{type:"search",value:s,onChange:e=>o(e.target.value),placeholder:"Search posts by title, summary, or tagâ¦",className:"w-full border border-paper-200 bg-paper-50 py-2.5 pl-10 pr-4 text-sm text-paper-900 placeholder:text-paper-400 focus:border-forest-400 focus:outline-none focus:ring-2 focus:ring-forest-100 dark:border-paper-700 dark:bg-paper-900 dark:text-paper-100 dar
1k:placeholder:text-paper-500 dark:focus:border-forest-600 dark:focus:ring-forest-950"})]}),b.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(e=>{let r=p.has(e.slug);return(0,a.jsxs)("button",{onClick:()=>toggleTag(e.slug),className:"rounded-sm border px-3 py-1 text-xs font-medium transition-colors ".concat(r?"border-forest-600 bg-forest-600 text-white dark:border-forest-500 dark:bg-forest-500":"border-paper-200 bg-paper-50 text-paper-600 hover:border-forest-400 hover:text-forest-600 dark:border-paper-700 dark:bg-paper-900 dark:text-paper-400 dark:hover:border-forest-600 dark:hover:text-forest-400"),children:["#",e.slug,(0,a.jsx)("span",{className:r?"ml-1 text-forest-100":"ml-1 text-paper-400 dark:text-paper-500",children:e.count})]},e.slug)})}),w&&(0,a.jsxs)("div",{className:"flex items-center gap-3 text-sm text-paper-500 dark:text-paper-400",children:[(0,a.jsxs)("span",{children:[k.length," result",1===k.length?"":"s"]}),(0,a.jsxs)("button",{onClick:()=>{o(""),c(new Set),m(1)},className:"inline-flex items-center gap-1 text-forest-600 hover:text-forest-500 dark:text-forest-400 dark:hover:text-forest-300",children:[(0,a.jsx)(f.Z,{size:13}),"Clear filters"]})]}),v.length>0?(0,a.jsx)(h.d,{posts:v,context:"writing"}):(0,a.jsx)("p",{className:"py-16 text-center text-paper-400 dark:text-paper-500",children:"No posts match your search."}),y>1&&(0,a.jsxs)("nav",{className:"flex items-center justify-center gap-1 pt-2","aria-label":"Pagination",children:[(0,a.jsx)("button",{onClick:()=>m(e=>Math.max(1,e-1)),disabled:1===j,className:"rounded-lg border border-paper-200 px-3 py-1.5 text-sm font-medium text-paper-600 transition-colors hover:border-forest-300 hover:text-forest-600 disabled:cursor-not-allowed disabled:opacity-40 dark:border-paper-700 dark:text-paper-400 dark:hover:border-forest-600 dark:hover:text-forest-400",children:"Prev"}),Array.from({length:y},(e,r)=>r+1).map(e=>(0,a.jsx)("button",{onClick:()=>m(e),"aria-current":e===j?"page":void 0,className:"h-8 w-8 rounded-lg text-sm font-medium transition-colors ".concat(e===j?"bg-forest-600 text-white dark:bg-forest-500":"text-paper-600 hover:bg-paper-100 dar
1k:text-paper-400 dark:hover:bg-paper-800"),children:e},e)),(0,a.jsx)("button",{onClick:()=>m(e=>Math.min(y,e+1)),disabled:j===y,className:"rounded-lg border border-paper-200 px-3 py-1.5 text-sm font-medium text-paper-600 transition-colors hover:border-forest-300 hover:text-forest-600 disabled:cursor-not-allowed disabled:opacity-40 dark:border-paper-700 dark:text-paper-400 dark:hover:border-forest-600 dark:hover:text-forest-400",children:"Next"})]})]})};var m=t(3922),g=t(8497);let b="https://sourishchakraborty.com";var k=!0;function Writing(e){var r;let{posts:t}=e,[s,u]=(0,n.useState)(!1),x=g.C;return(0,a.jsx)(i.w,{publication:x,children:(0,a.jsxs)(c.A,{children:[(0,a.jsxs)(o(),{children:[(0,a.jsx)("title",{children:"Writing â Sourish Chakraborty"}),(0,a.jsx)("meta",{name:"description",content:"Deep technical posts on AI systems, data platforms, and platform engineering â search, browse by tag, or page through the full archive."}),(0,a.jsx)("meta",{name:"robots",content:"index, follow"}),(0,a.jsx)("link",{rel:"canonical",href:"".concat(b,"/writing")}),(0,a.jsx)("meta",{property:"og:type",content:"website"}),(0,a.jsx)("meta",{property:"og:url",content:"".concat(b,"/writing")}),(0,a.jsx)("meta",{property:"og:title",content:"Writing â Sourish Chakraborty"}),(0,a.jsx)("meta",{property:"og:image",content:null!==(r=x.ogMetaData.image)&&void 0!==r?r:""})]}),(0,a.jsx)(d.u,{onSubscribeClick:()=>u(!0)}),(0,a.jsx)("section",{className:"border-b border-paper-200 pb-10 pt-12 dark:border-paper-800",children:(0,a.jsxs)(l.W,{className:"max-w-4xl",children:[(0,a.jsx)("h1",{className:"font-display text-4xl font-bold tracking-tight text-paper-900 dark:text-paper-50",children:"Writing"}),(0,a.jsxs)("p",{className:"mt-3 max-w-lg text-base leading-relaxed text-paper-600 dark:text-paper-400",children:[t.length," post",1===t.length?"":"s"," on AI systems, data platforms, and platform engineering. Search, filter by tag, or page through the archive."]})]})}),(0,a.jsx)("section",{className:"py-10",children:(0,a.jsx)(l.W,{className:"max-w-4xl",children:(0,a.jsx)(PostExplorer,{posts:t})})}),(0,a.jsx)(p.$,{}),(0,a.jsx)(m.p,{show:s,onClose:()=>u(!1)})]})})}}},function(e){e.O(0,[9985,5512,8397,6531,9774,2888,179],function(){return e(e.s=6905)}),_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.