import{d as k}from"./CCRhw9W4.js";import{d as f,a as g,aA as C,o as n,m as s,D as d,k as t,F as a,n as _,t as b}from"./zEcrVex8.js";const h=["innerHTML"],v={class:"shiki"},y=["textContent"],H=f({__name:"NCodeBlock",props:{code:{},lang:{},lines:{type:Boolean,default:!0},transformRendered:{}},emits:["loaded"],setup(c,{emit:i}){const o=c,p=i,l=g(()=>{const e=o.lang==="text"?{code:o.code,supported:!1}:k.value?.devtools.renderCodeHighlight(o.code,o.lang)||{code:o.code,supported:!1};return e.supported&&o.transformRendered&&(e.code=o.transformRendered(e.code)),e.supported&&C(()=>p("loaded")),e});return(e,r)=>e.lang&&l.value.supported?(n(),s("pre",{key:0,class:d(["n-code-block",e.lines?"n-code-block-lines":""]),innerHTML:l.value.code},null,10,h)):(n(),s("pre",{key:1,class:d(["n-code-block",e.lines?"n-code-block-lines":""])},[t("pre",v,[t("code",null,[(n(!0),s(a,null,_(e.code.split(`
`),(u,m)=>(n(),s(a,{key:m},[t("span",{class:"line",textContent:b(u)},null,8,y),r[0]||(r[0]=t("br",null,null,-1))],64))),128))])])],2))}});export{H as _};
