import{_ as e,a as t,b as n,v as r}from"./i18n-DfIivedY.js";var i=e(),a=n(r(),1),o=t();function s(e){let t=(0,i.c)(7),{markdown:n,variant:r}=e,a=r===void 0?`chat`:r,s;if(t[0]!==n||t[1]!==a){let e=u(n),r=a===`changelog`?c:l,i;t[3]===r?i=t[4]:(i=(e,t)=>e.kind===`spacer`?null:e.kind===`heading`?e.level===2?(0,o.jsx)(`h3`,{className:r.h2,children:d(e.text,r)},t):(0,o.jsx)(`h4`,{className:r.h3,children:d(e.text,r)},t):e.kind===`bullets`?(0,o.jsx)(`ul`,{className:r.ul,children:e.items.map((e,t)=>(0,o.jsx)(`li`,{children:d(e,r)},t))},t):(0,o.jsx)(`p`,{className:r.p,children:d(e.text,r)},t),t[3]=r,t[4]=i),s=e.map(i),t[0]=n,t[1]=a,t[2]=s}else s=t[2];let f;return t[5]===s?f=t[6]:(f=(0,o.jsx)(o.Fragment,{children:s}),t[5]=s,t[6]=f),f}var c={h2:`mt-6 text-base font-semibold text-slate-900`,h3:`mt-5 text-sm font-semibold text-slate-900`,ul:`mt-2 list-disc space-y-1 ps-6 text-[15px] leading-7 text-slate-700`,p:`mt-3`,code:`rounded bg-slate-100 px-1 font-mono text-[0.9em] text-slate-800`,bold:`font-semibold text-slate-900`},l={h2:`mt-3 first:mt-0 text-sm font-semibold leading-tight`,h3:`mt-2 first:mt-0 text-sm font-semibold leading-tight`,ul:`my-1 list-disc space-y-0.5 ps-5`,p:`mt-1 first:mt-0`,code:`rounded bg-foreground/10 px-1 font-mono text-[0.85em]`,bold:`font-semibold`};function u(e){let t=e.replace(/\r\n?/g,`
`).split(`
`),n=[],r=null,i=null,a=()=>{r&&r.length>0&&n.push({kind:`bullets`,items:r}),r=null},o=()=>{i&&i.length>0&&n.push({kind:`paragraph`,text:i.join(` `)}),i=null};for(let e of t){let t=e.trim();if(t===``){a(),o(),n.push({kind:`spacer`});continue}if(t.startsWith(`### `)){a(),o(),n.push({kind:`heading`,level:3,text:t.slice(4)});continue}if(t.startsWith(`## `)){a(),o(),n.push({kind:`heading`,level:2,text:t.slice(3)});continue}if(t.startsWith(`- `)||t.startsWith(`* `)){o(),r===null&&(r=[]),r.push(t.slice(2));continue}a(),i===null&&(i=[]),i.push(t)}return a(),o(),n}function d(e,t){let n=[],r=0;for(;r<e.length;){let t=e.slice(r),i=t.match(/^`([^`]+)`/);if(i){n.push({kind:`code`,text:i[1]}),r+=i[0].length;continue}let a=t.match(/^\*\*([^*]+)\*\*/);if(a){n.push({kind:`bold`,text:a[1]}),r+=a[0].length;continue}let o=t.search(/`|\*\*/);if(o===-1){n.push(t),r=e.length;continue}n.push(t.slice(0,o)),r+=o}return n.map((e,n)=>typeof e==`string`?(0,o.jsx)(a.Fragment,{children:e},n):e.kind===`code`?(0,o.jsx)(`code`,{className:t.code,children:e.text},n):(0,o.jsx)(`strong`,{className:t.bold,children:e.text},n))}export{s as t};