import{P as a}from"./prismjs-BZPoR7_J.js?v=1773287522785";import{bn as m}from"./index-BTglIPU2.js?v=1773287522785";import{f as h,a9 as p}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as w,R as y,r as l,c as u,w as S,o as v,a0 as o,n as _}from"./vue-core-DJjvd5ZC.js?v=1773287522785";const b=m({height:"100%","&[class*='language-']":{border:"none",margin:0},".line-numbers":{whiteSpace:"pre-wrap"}}),P=w({name:"BtPrism",props:{lang:{type:String,default:"logs"},content:{type:String,default:""},loading:{type:Boolean,default:!1},wrap:{type:Boolean,default:!1},fontSize:{type:[String,Number],default:"14px"},rows:{type:Number,default:100},preStyle:{type:Object,default:()=>{}}},setup(e){const{t:c}=y(),t=l(null),n=l(null),r=l(""),g=u(()=>{const d=e.wrap?{wordWrap:"break-word"}:{};return{fontSize:h(e.fontSize),...d,...e.preStyle}}),s=u(()=>e.content===""?[c("Component.Logs.index_1")]:e.content.split("\n").slice(-1*(e.rows+1)));S(()=>s.value,()=>{i()});const i=async()=>{r.value=a.highlight(s.value.join("\n"),a.languages[e.lang],e.lang),await _(),n.value&&a.highlightElement(n.value),f()},f=()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)};return v(()=>{i()}),()=>o(p,{show:e.loading},{default:()=>[o("pre",{ref:t,class:[b,"language-".concat(e.lang),"line-numbers"],style:g.value},[o("code",{ref:n,innerHTML:r.value},null)])]})}});export{P as _};
