1import{j as e,h as y,r as x,L as j,N as v}from"./react-vendor-CR6PEHFZ.js";import{P as w}from"./PaintedText-C3MsEoHx.js";import{N as k,E as P,R as $,H as B}from"./index-4BgFHtDy.js";import{t as E,c as C,s as L,p as S,d as T,e as A,g as D,h as M,a as u}from"./blog-BWMf15EB.js";import{B as z,a as H}from"./BlogContent-CCKpDCR5.js";import{W as R}from"./SeoLinkChip-r4Goi5Rw.js";import"./charts-B4FZmgI2.js";import"./motion-CJOt5odT.js";import"./sentry-vendor-TOuwz_QY.js";import"./index-qrFtx_x8.js";import"./triangle-alert-BSz8P4Zw.js";import"./thumbs-up-BGwgimrl.js";import"./info-Dr44RUm_.js";import"./SeoFaq-j-N6tMfY.js";import"./normalizeHref-DQzPdX4G.js";function U(l){if(!l)return[];const o=new z,a=[];let t=!1,r="",s=0;for(const i of l.split(` 2`)){const c=i,m=c.match(/^\s*(```+|~~~+)/);if(m){const h=m[1][0];t?h===r&&(t=!1,r=""):(t=!0,r=h);continue}if(t)continue;if(/^:{3,}[A-Za-z]/.test(c)){s++;continue}if(/^:{3,}\s*$/.test(c)){s=Math.max(0,s-1);continue}if(s>0)continue;const p=c.match(/^(#{2,3})\s+(.+?)\s*#*\s*$/);if(!p)continue;const b=p[1].length,g=p[2].replace(/`([^`]*)`/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[*_~]/g,"").trim();g&&a.push({id:o.slug(g),text:g,depth:b})}return a}function f({markdown:l}){const o=U(l);if(o.length<3)return null;const a=[];for(const t of o)t.depth===2||a.length===0?a.push({...t,children:[]}):a[a.length-1].children.push(t);return e.jsxs("nav",{className:"blog-toc","aria-label":"Table of contents",children:[e.jsx(R,{label:"On this page",jp:"ç®æ¬¡"}),e.jsx("ul",{className:"blog-toc-list",children:a.map((t,r)=>e.jsx("li",{className:"blog-toc-cat",children:t.children.length>0?e.jsxs("details",{className:"blog-toc-details",children:[e.jsxs("summary",{className:"blog-toc-summary",children:[e.jsx("a",{href:`#${t.id}`,className:"blog-toc-link blog-toc-link--cat",onClick:s=>s.stopPropagation(),children:t.text}),e.jsx("span",{className:"blog-toc-chev","aria-hidden":"true"})]}),e.jsx("ul",{className:"blog-toc-sublist",children:t.children.map((s,i)=>e.jsx("li",{children:e.jsx("a",{href:`#${s.id}`,className:"blog-toc-link blog-toc-link--sub",children:s.text})},`${s.id}-${i}`))})]}):e.jsx("a",{href:`#${t.id}`,className:"blog-toc-link blog-toc-link--cat",children:t.text})},`${t.id}-${r}`))})]})}function te({surface:l="blog"}){const{slug:o=""}=y(),[a,t]=x.useState(()=>E(o)),[r,s]=x.useState(a?"ready":"loading");if(x.useEffect(()=>{if(a&&a.slug===o){s("ready");return}const n=new AbortController;return s("loading"),t(null),C(o,n.signal).then(d=>{if(!d){s("notfound");return}t(d),s("ready")}).catch(d=>{d?.name!=="AbortError"&&s("error")}),()=>n.abort()},[o]),r==="notfound")return e.jsx(k,{});if(r==="error")return e.jsx("div",{className:"wc-root blog-page",children:e.jsxs("div",{className:"wrap blog-article",children:[e.jsx("div",{className:"blog-back-row",children:e.jsx(j,{to:"/blog",className:"blog-back",children:"â All articles"})}),e.jsx("div",{className:"blog-empty",children:"Could not load this article. Please try again later."})]})});if(r==="loading"||!a)return e.jsx("div",{className:`wc-root blog-page${l==="compare"?" blog-page--compare":""}`,children:e.jsx("div",{className:"wrap blog-loading","aria-live":"polite","aria-busy":"true",children:e.jsx(P,{image:l==="compare"?"/watercolor/enso-animation/enso-pink.png":"/watercolor/enso-animation/enso-blue.png",size:96,duration:1.1,repeatDelay:.3})})});const i=L(a.post_type);if(i!==l)return e.jsx(v,{to:`/${i}/${a.slug}`,replace:!0});const c=`/${i}`,m=a.post_type==="comparator",p=S(a),b=T(a),g=A(a),h=D(a),N=M(a),_=!!a.updated_at&&!!a.published_at&&u(a.updated_at)!==u(a.published_at);return e.jsxs("div",{className:`wc-root blog-page${m?" blog-page--compare":""}`,children:[e.jsx($,{title:p,description:b,canonical:h,ogImage:g,robots:a.noindex?"noindex, follow":"index, follow"}),e.jsxs(B,{children:[e.jsx("meta",{property:"og:type",content:"article"}),a.published_at&&e.jsx("meta",{property:"article:published_time",content:a.published_at}),a.updated_at&&e.jsx("meta",{property:"article:modified_time",content:a.updated_at}),e.jsx("meta",{property:"article:author",content:a.author_name}),N.map((n,d)=>e.jsx("script",{type:"application/ld+json",children:n},d))]}),e.jsxs("article",{className:"wrap blog-article",children:[e.jsxs("header",{className:"blog-article-hero",children:[e.jsx("h1",{className:"blog-article-title",children:e.jsx(w,{paint:"blue",children:a.title})}),a.subtitle&&e.jsx("p",{className:"blog-article-subtitle",children:a.subtitle}),e.jsxs("div",{className:"blog-article-meta",children:[e.jsx("span",{children:a.author_name}),a.published_at&&e.jsxs("span",{children:["· ",u(a.published_at)]}),_&&e.jsxs("span",{children:["· Updated ",u(a.updated_at)]}),a.reading_minutes?e.jsxs("span",{children:["· ",a.reading_minutes," min read"]}):null]})]}),a.cover_image_url?e.jsxs("div",{className:"blog-article-head",children:[e.jsx("div",{className:"blog-article-cover",children:e.jsx("img",{src:a.c
2over_image_url,alt:a.cover_image_alt||"",decoding:"async"})}),e.jsx(f,{markdown:a.content_md})]}):e.jsx(f,{markdown:a.content_md}),e.jsx(H,{markdown:a.content_md}),a.keywords&&a.keywords.length>0&&e.jsx("div",{className:"blog-tags","aria-label":"Tags",children:a.keywords.map(n=>e.jsx("span",{className:"blog-tag",children:n},n))}),e.jsx("div",{className:"blog-author-card wc-pencil-frame wc-pencil-frame--sm",children:e.jsxs("div",{className:"blog-author-body",children:[e.jsx("div",{className:"blog-author-name",children:a.author_name}),e.jsx("p",{className:"blog-author-bio",children:"Written by the team building Shizen Learn â an app that uses spaced repetition across kana, grammar, vocabulary, and kanji to fast-track Japanese learners toward real immersion."})]})}),e.jsx("footer",{className:"blog-article-footer",children:e.jsxs(j,{to:c,className:"blog-back",children:["â Back to ",m?"all comparisons":"all articles"]})})]})]})}export{te as BlogPostPage};
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.