System.register(["./xterm-addon-canvas-legacy.js?v=1753954525509","./xterm-legacy.js?v=1753954525509","./public-legacy.js?v=1753954525509","./vue-legacy.js?v=1753954525509"],(function(e,n){"use strict";var o,t,a,r,l,s,d,i,c,u,m,v,f,w,g;return{setters:[e=>{o=e.x},e=>{t=e.x,a=e.a,r=e.b,l=e.c},e=>{s=e.z},e=>{d=e.k,i=e.P,c=e.r,u=e.an,m=e.o,v=e.b,f=e.U,w=e.V,g=e.n}],execute:function(){var n=document.createElement("style");n.textContent=".drawer{display:none}.xterm{height:100%;padding:12px}.xterm .xterm-viewport{overflow:auto!important}\n",document.head.appendChild(n),e("_",d({__name:"index",props:{url:{default:"/ws_model"},data:{default:()=>[]}},emits:["message"],setup(e,{emit:n}){const d=e,x=n,{t:p}=i(),{ws:A,status:h,send:y,close:C}=s(d.url,{onMessage:(e,n)=>{const o=n.data;return x("message",o),o.indexOf("Authentication timeout.")>-1&&(O.value=!0),-1==o.indexOf("@127.0.0.1:")&&-1==o.indexOf("@localhost:")||-1==o.indexOf("Authentication failed")?"\\r\\nlogout\\r\\n"==o||"logout\\r\\n"==o||"\r\nlogout\r\n"==o||"logout\r\n"==o||o.search(/logout[\r\n]+$/)>-1?(b.write("\r"+p("Component.Terminal.index_1")+"\r"),M(),void C()):void 0:(C(),void M())}});let b,_;const O=c(!1),k=c(null),j=()=>{const e=A.value;e&&(b.loadAddon(_),b.loadAddon(new o.CanvasAddon),b.loadAddon(new r.WebLinksAddon),b.loadAddon(new l.AttachAddon(e)))},z=()=>{k.value&&b.open(k.value)};let E=!1;const M=()=>{E=!1},S=()=>{(()=>{const{data:e}=d;e.forEach((e=>{y(e)}))})(),b.focus(),b.onData((e=>{const n=A.value;"\r"===e&&O.value&&(O.value=!1,b.write("\r\n"),T()),null!==n||"\r"!==e||E||(E=!0,b.write("\r\n"+p("Component.Terminal.index_2")+"\r\n"),T())}))},T=()=>{S();const e=A.value;e&&b.loadAddon(new l.AttachAddon(e))},D=()=>{g((()=>{if(_.fit(),"CLOSED"!==h.value){const{cols:e,rows:n}=b;y({cols:e,rows:n,resize:1})}}))};let F=!0;const L=new ResizeObserver((()=>{u((()=>{F?F=!1:D()}),200)()}));return m((()=>{b=new t.Terminal({cursorBlink:!0,fontSize:14,fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#333",foreground:"#ececec"}}),_=new a.FitAddon,j(),z(),S(),D(),(()=>{const e=k.value;e&&L.observe(e)})()})),v((()=>{C(),L?.disconnect(),b?.dispose()})),(e,n)=>(f(),w("div",{ref_key:"terminalRef",ref:k,class:"w-full h-full"},null,512))}}))}}}));
