import{d as k}from"./client-e80cnnsl.js";import{k as f,l as g,n as C,R as n,U as s,Z as d,V as t,F as a,ac as _,a6 as b}from"./vendor/json-editor-vue-gplv2x2n.js";const h=["innerHTML"],v={class:"shiki"},y=["textContent"],T=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{T as _};
