1import{r as x,j as e,R as m,g as h,a as p,b as u,L as f,f as g}from"./index-BZl0FSVx.js";import{c,F as j,S as b,a as y}from"./SiteFooter-p5UAsLo9.js";import{A as w}from"./ArticleCard-BjEDUw02.js";const N=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],v=c("check",N);const C=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],k=c("copy",C);const S=[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]],_=c("twitter",S);function i({title:r}){const[t,a]=x.useState(!1),o=async()=>{typeof window>"u"||(await navigator.clipboard.writeText(window.location.href),a(!0),setTimeout(()=>a(!1),2e3))},s=typeof window<"u"?window.location.href:"",n=`https://twitter.com/intent/tweet?text=${encodeURIComponent(r)}&url=${encodeURIComponent(s)}`,l=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(s)}`,d=`https://wa.me/?text=${encodeURIComponent(r+" "+s)}`;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Share:"}),e.jsx("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":"Share on Twitter",className:"rounded-full border border-border p-2 hover:border-primary hover:text-primary",children:e.jsx(_,{className:"h-4 w-4"})}),e.jsx("a",{href:l,target:"_blank",rel:"noreferrer","aria-label":"Share on Facebook",className:"rounded-full border border-border p-2 hover:border-primary hover:text-primary",children:e.jsx(j,{className:"h-4 w-4"})}),e.jsx("a",{href:d,target:"_blank",rel:"noreferrer","aria-label":"Share on WhatsApp",className:"rounded-full border border-border p-2 hover:border-primary hover:text-primary text-xs font-bold",children:"WA"}),e.jsxs("button",{onClick:o,"aria-label":"Copy link",className:"flex items-center gap-1 rounded-full border border-border px-3 py-2 text-xs font-semibold hover:border-primary hover:text-primary",children:[t?e.jsx(v,{className:"h-4 w-4"}):e.jsx(k,{className:"h-4 w-4"}),t?"Copied":"Copy link"]})]})}function I(){const{article:r}=m.useLoaderData(),t=h(r.category),a=r.subCategory?p(r.category,r.subCategory):void 0,o=u(r.slug);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(b,{}),e.jsxs("main",{children:[e.jsxs("article",{children:[e.jsxs("header",{className:"mx-auto max-w-4xl px-4 pt-10 pb-6",children:[t&&e.jsxs(f,{to:"/category/$category",params:{category:t.slug},className:"text-xs font-bold uppercase tracking-wider text-primary hover:underline",children:[t.name,a?` · ${a.name}`:""]}),e.jsx("h1",{className:"mt-3 font-serif text-4xl font-black leading-[1.05] tracking-tight md:text-6xl",children:r.title})]}),e.jsx("div",{className:"mx-auto max-w-4xl px-4",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-y border-border py-3",children:[e.jsxs("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:["By"," ",r.authorUrl?e.jsx("a",{href:r.authorUrl,target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-foreground hover:text-primary hover:underline",children:r.author}):e.jsx("span",{className:"font-semibold text-foreground",children:r.author}),e.jsx("span",{className:"mx-2",children:"·"}),g(r.publishedAt),e.jsx("span",{className:"mx-2",children:"·"}),r.readingMinutes," min read"]}),e.jsx(i,{title:r.title})]})}),e.jsx("figure",{className:"mx-auto mt-6 max-w-5xl px-4",children:e.jsx("img",{src:r.coverImage,alt:r.coverAlt,className:"w-full object-cover"})}),e.jsxs("div",{className:"mx-auto mt-10 max-w-2xl px-4",children:[e.jsx("div",{className:"article-body",children:r.body.map((s,n)=>e.jsx(R,{block:s},n))}),e.jsx("div",{className:"mt-10 border-t border-border pt-6",children:e.jsx(i,{title:r.title})})]})]}),o.length>0&&e.jsxs("section",{className:"mx-auto mt-20 max-w-7xl px-4",children:[e.jsx("h2",{className:"mb-6 border-b border-foreground pb-2 font-serif text-2xl font-bold",children:"Related Stories"}),e.jsx("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:o.map(s=>e.jsx(w,{article:s},s.slug))})]})]}),e.jsx(y,{})]})}function R({block:r}){switch(r.type){case"p":return e.jsx("p",{children:r.text});case"h2":return e.jsx("h2",{children:r.text});case"h3":return e.jsx("h3",{children:r.text});case"quote":return e.jsxs("blockquote",{children:['"',r.text,'"',r.cite&&e.jsxs("footer",{className:"mt-2 text-sm not-italic text-muted-foreground",children:["â ",r.cite]})]});case"image":return e.jsxs("figure",{className:"my-6",children:[e.jsx("img",{src:r.src,alt:r.alt,className:"w-full"}),r.caption&&e.jsx("figcaption",{className:"mt-2 text-center text-xs text-muted-foreground",children:r.caption})]});case"ul":return e.jsx("ul",{children:r.items.map((t,a)=>e.jsx("li",{children:t},a))});case"ol":return e.jsx("ol",{children:r.items.map((t,a)=>e.jsx("li",{children:t},a))})}}export{I as component};
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.