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