import{b_ as e}from"./utils-lib.js?v=20260328163632";import{B as s}from"./index118.js?v=20260328163632";import{k as a,r as o,w as l,V as t,_ as n,Y as c}from"./base-lib.js?v=20260328163632";const u=a({__name:"index",props:{compData:{default:()=>({name:""})}},emits:["close"],setup(a,{expose:u,emit:m}){const r=a,i=m,p=o("");let d=null;const f=s=>{d=e({route:"/ws/"+s,onMessage:b})},b=async(e,s)=>{const a=JSON.parse(s.data);a.msg&&(p.value+=(p.value?"\n":"")+a.msg,p.value.includes("Successfully")&&setTimeout((()=>{null==d||d.close(),r.compData.onRefresh&&r.compData.onRefresh(),i("close")}),1e3))};return l((()=>r.compData.name),(e=>{e&&(p.value="",f(e))}),{immediate:!0}),u({clean:()=>{p.value="",d&&(null==d||d.close()),d=null},createWebSocket:f}),(e,a)=>(t(),n(s,{class:"!rounded-none",content:c(p),autoScroll:!0},null,8,["content"]))}});export{u as _};
