import{E as x,y as k,I as w,w as B,x as D}from"./element-plus.ae8e286c.js";import{f as r,b as T}from"./index.71fc8348.js";import{u as j}from"./vue-clipboard3.add720e2.js";import{d as N,r as U,b as $,a3 as F,o as s,c as m,T as o,K as t,U as R,a6 as S,u as I,j as J,J as K,a as i,R as L}from"./@vue.108c970a.js";const P={class:"code-preview"},q={class:"flex",style:{height:"50vh"}},z=L(" \u590D\u5236 "),Q=N({__name:"code-preview",props:{modelValue:{type:Boolean},code:null},emits:["update:modelValue"],setup(c,{emit:p}){const _=c,{toClipboard:f}=j(),u=U("index0"),b=async l=>{try{await f(l),r.msgSuccess("\u590D\u5236\u6210\u529F")}catch{r.msgError("\u590D\u5236\u5931\u8D25")}},n=$({get(){return _.modelValue},set(l){p("update:modelValue",l)}});return(l,a)=>{const h=F("highlightjs"),V=x,v=T,g=B,y=D,C=k,E=w;return s(),m("div",P,[o(E,{modelValue:I(n),"onUpdate:modelValue":a[1]||(a[1]=e=>J(n)?n.value=e:null),width:"900px",title:"\u4EE3\u7801\u9884\u89C8"},{default:t(()=>[o(C,{modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=e=>u.value=e)},{default:t(()=>[(s(!0),m(R,null,S(c.code,(e,d)=>(s(),K(y,{label:e.name,name:`index${d}`,key:d},{default:t(()=>[i("div",q,[o(V,{class:"flex-1"},{default:t(()=>[o(h,{autodetect:"",code:e.content},null,8,["code"])]),_:2},1024),i("div",null,[o(g,{onClick:A=>b(e.content),type:"primary",link:""},{icon:t(()=>[o(v,{name:"el-icon-CopyDocument"})]),default:t(()=>[z]),_:2},1032,["onClick"])])])]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])])}}});export{Q as _};
