1import{c as i,al as b,k as p,am as g,u as f,an as j,j as e,l as N,L as d,ao as v,ap as k,F as w,r as y,aq as S,h as _}from"./index-BCW6nnV8.js";import{S as s}from"./skeleton-DrEiwWGX.js";import{C as $}from"./clock-CZ7OH7Ic.js";const C=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],T=i("link-2",C);const A=[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]],L=i("linkedin",A);const M=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],q=i("tag",M);const z=[["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"}]],F=i("twitter",z);function R({url:t,title:o}){const[m,l]=y.useState(!1),n=encodeURIComponent(t),x=encodeURIComponent(o);return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs uppercase tracking-wider text-muted-foreground mr-1",children:"Share"}),e.jsx("a",{href:`https://twitter.com/intent/tweet?url=${n}&text=${x}`,target:"_blank",rel:"noopener noreferrer","aria-label":"Share on Twitter",className:"rounded-full border border-border bg-surface p-2 text-muted-foreground hover:border-brand hover:text-brand transition",children:e.jsx(F,{className:"h-4 w-4"})}),e.jsx("a",{href:`https://www.facebook.com/sharer/sharer.php?u=${n}`,target:"_blank",rel:"noopener noreferrer","aria-label":"Share on Facebook",className:"rounded-full border border-border bg-surface p-2 text-muted-foreground hover:border-brand hover:text-brand transition",children:e.jsx(S,{className:"h-4 w-4"})}),e.jsx("a",{href:`https://www.linkedin.com/sharing/share-offsite/?url=${n}`,target:"_blank",rel:"noopener noreferrer","aria-label":"Share on LinkedIn",className:"rounded-full border border-border bg-surface p-2 text-muted-foreground hover:border-brand hover:text-brand transition",children:e.jsx(L,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),1500)}catch{}},"aria-label":"Copy link",className:"rounded-full border border-border bg-surface p-2 text-muted-foreground hover:border-brand hover:text-brand transition",children:m?e.jsx(_,{className:"h-4 w-4"}):e.jsx(T,{className:"h-4 w-4"})})]})}function E(){const{handle:t}=b.useParams(),o=b.useLoaderData(),m=p(g),{data:l,isLoading:n,isError:x}=f({queryKey:["blog-article",t],queryFn:()=>m({data:{handle:t}}),staleTime:1e3*60*10,initialData:o?.article?{article:o.article,related:o.related??[]}:void 0}),r=l?.article,h=l?.related??[],u=`${k}/blog/${t}`,c=j(t)?.cta;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(N,{}),e.jsxs("main",{className:"mx-auto max-w-3xl px-4 md:px-6 py-12",children:[e.jsx(d,{to:"/blogs",className:"text-sm text-brand hover:underline",children:"â Back to blog"}),n?e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsx(s,{className:"h-4 w-20"}),e.jsx(s,{className:"h-10 w-3/4"}),e.jsx(s,{className:"h-4 w-1/3"}),e.jsx(s,{className:"aspect-video w-full rounded-xl"}),e.jsxs("div",{className:"space-y-3 pt-4",children:[e.jsx(s,{className:"h-4 w-full"}),e.jsx(s,{className:"h-4 w-full"}),e.jsx(s,{className:"h-4 w-5/6"})]})]}):x||!r?e.jsxs("div",{className:"mt-8 rounded-xl border border-dashed border-border p-10 text-center",children:[e.jsx("p",{className:"text-lg font-semibold",children:"Article not found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"This article may have been moved or removed."}),e.jsx(d,{to:"/blogs",className:"mt-5 inline-block rounded-md border border-brand px-4 py-2 text-sm font-semibold text-brand hover:bg-brand hover:text-background transition",children:"Browse all articles â"})]}):e.jsxs("article",{className:"mt-6",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-brand font-semibold",children:r.tags[0]??"News"}),e.jsx("h1",{className:"mt-2 text-3xl md:text-4xl font-display font-bold tracking-tight",children:r.title}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground",children:[r.publishedAt&&e.jsx("span",{children:r.publishedAt}),r.author&&e.jsxs("span",{children:["· ",r.author]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx($,{className:"h-3.5 w-3.5"}),r.readingMinutes," min read"]})]}),r.imageUrl&&e.jsx("img",{src:r.imageUrl,alt:r.title,loading:"lazy",decoding:"async",className:"mt-6 w-full rounded-xl"}),e.jsx(v,{html:r.contentHtml,className:"mt-8 blog-article"}),c&&e.jsxs("aside",{className:"mt-10 rounded-2xl border border-brand/40 bg-brand/5 p-6",children:[e.jsx("h2",{className:"font-display text-xl font-bold uppercase",children:c.heading}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:c.text}),e.jsx("div",{className:"mt-4 flex flex-wrap gap-3",children:c.links.map(a=>e.jsxs(d,{to:"/shop",search:{collection:a.collection},className:"rounded-md bg-brand px-4 py-2 text-sm font-semibold text-background hover:opacity-90 transition",children:[a.label," â"]},a.collection))})]}),r.tags.length>0&&e.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4 text-muted-foreground"}),r.tags.map(a=>e.jsx(d,{to:"/blogs",search:{tag:a},className:"rounded-full border border-border bg-surface px-3 py-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground hover:border-brand hover:text-brand transition",children:a},a))]}),e.jsx("div",{className:"mt-8 border-t border-border pt-6",children:e.jsx(R,{url:u,title:r.title})}),h.length>0&&e.jsxs("section",{className:"mt-16",children:[e.jsx("h2",{className:"font-display text-2xl font-bold mb-6",children:"Related articles"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:h.map(a=>e.jsxs(d,{to:"/blog/$handle",params:{handle:a.handle},className:"group rounded-xl overflow-hidden border border-border bg-surface hover:border-brand transition",children:[e.jsx("div",{className:"aspect-video overflow-hidden bg-surface/70",children:e.jsx("img",{src:a.imageUrl||"/og-image.png",alt:a.title,loading:"lazy",decoding:"async",className:"h-full w-full object-cover group-hover:scale-105 transition"})}),e.jsxs("div",{className:"p-4",children:[e.jsx("h3",{className:"text-sm font-semibold group-hover:text-brand transition line-clamp-2",children:a.title}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[a.publishedAt??"",` · ${a.readingMinutes} min`]})]})]},a.handle))})]})]})]}),e.jsx(w,{})]})}
1export{E 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.