System.register(["./xterm-addon-canvas-legacy.js?v=1763625242172","./xterm-legacy.js?v=1763625242172","./public-legacy.js?v=1763625242172","./vue-legacy.js?v=1763625242172"],(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.C},e=>{d=e.k,i=e.P,c=e.r,u=e.ap,m=e.o,v=e.b,f=e.R,w=e.S,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,p=n,{t:x}=i(),{ws:A,status:h,send:y,close:C}=s(d.url,{onMessage:(e,n)=>{const o=n.data;return p("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"+x("Component.Terminal.index_1")+"\r"),E(),void C()):void 0:(C(),void E())}});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)))},S=()=>{k.value&&b.open(k.value)};let z=!1;const E=()=>{z=!1},M=()=>{(()=>{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"),R()),null!==n||"\r"!==e||z||(z=!0,b.write("\r\n"+x("Component.Terminal.index_2")+"\r\n"),R())}))},R=()=>{M();const e=A.value;e&&b.loadAddon(new l.AttachAddon(e))},T=()=>{g((()=>{if(_.fit(),"CLOSED"!==h.value){const{cols:e,rows:n}=b;y({cols:e,rows:n,resize:1})}}))};let D=!0;const F=new ResizeObserver((()=>{u((()=>{D?D=!1:T()}),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(),S(),M(),T(),(()=>{const e=k.value;e&&F.observe(e)})()})),v((()=>{C(),F?.disconnect(),b?.dispose()})),(e,n)=>(f(),w("div",{ref_key:"terminalRef",ref:k,class:"w-full h-full"},null,512))}}))}}}));
