import{S as e,l as t,m as n,p as r,t as i}from"./client-DWauEnMw.js";async function a(t){let[{marked:n},r]=await Promise.all([e(()=>import(`./marked.esm-d6uq5Mo2.js`),[]),e(()=>import(`./purify.es-BZ-8_tV6.js`),[])]),a=r.default,o=await(await i().fsRead(t)).text(),s=await Promise.resolve(n.parse(o,{gfm:!0,breaks:!1}));return a.sanitize(s)}function o({file:e}){let[i,o]=t({status:`loading`});return r(()=>{let t=!1;return o({status:`loading`}),a(e.path).then(e=>{t||o({status:`ready`,html:e})}).catch(e=>{t||o({status:`error`,error:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},[e.path]),i.status===`loading`?n(`p`,{style:`color:var(--muted);font-size:13px;padding:16px`,children:`Loading…`}):i.status===`error`?n(`p`,{role:`alert`,style:`color:var(--err);font-size:13px;padding:16px`,children:[`Couldn't render markdown: `,i.error]}):n(`div`,{class:`md-preview`,style:`padding:20px 24px;font-family:var(--f-sans);font-size:14px;line-height:1.65;color:var(--ink)`,dangerouslySetInnerHTML:{__html:i.html??``}})}export{o as MarkdownPreview};
//# sourceMappingURL=MarkdownPreview-DZUEn68c.js.map