1import{dw as me,cg as Te,j as ae,y as pe,o as he,ef as fe,r as A,v as c,d as P,R as ye,a as w,b as T,S as a,p as h,t as U,T as ge,U as B,f as u,e as M,af as R,D as Se,G as se,eI as be,w as z,aP as Ae,W as Ee,eg as Ue,z as te,eJ as Re,db as De,eh as ce,bH as Oe,u as G,df as ne,eK as Fe,be as $e,eL as Ne,bB as Pe,ee as de,aq as Y,s as E,ac as Be,bz as Ke,N as xe,F as Ze,L as Ie,c as j,cQ as ze,P as ve,l as Ve,ad as Ye,av as Q,eC as J,m as je,H as Ge,ah as He,k as qe,cF as We,aY as Xe}from"./index-DcSVvNrM.js";import{r as Ce,u as D,a as Qe}from"./index-C30mbp0T.js";import{u as oe}from"./useEnergyBalance-CxhVxtkn.js";import{u as we}from"./useTerminalSettings-FJ5QtKwH.js";const Z=me(Te(()=>{const C=Ce(),v=ae(),{t:s}=D(),{alert:n,AlertType:e}=pe(),r=A(!1),o=A(!1),f=A(!1),g=c(()=>C.getChats()),p=c(()=>C.getChatsCursor()),b=c(()=>p.value!==null);async function t(_=!1){if(!r.value){r.value=!0;try{await C.loadChats(_?void 0:p.value,_),f.value=!0}catch(k){console.error(k),n({type:e.Error,text:s("terminal.errorLoadChats")})}finally{r.value=!1}}}async function $(){b.value&&await t(!1)}async function m(_){if(o.value)return null;o.value=!0;try{const k=C.createChat(_===void 0?{}:{name:_});return await v.push({name:"TerminalChat",params:{chatUuid:k.uuid}}),k}catch(k){return console.error(k),n({type:e.Error,text:s("terminal.errorCreateChat")}),null}finally{o.value=!1}}async function d(_){await v.push({name:"TerminalChat",params:{chatUuid:_}})}async function l(){await v.push({name:"TerminalHome",query:{compose:"1"}})}function L(_){const k=_.name;return k!==null&&k.trim().length>0?k:s("terminal.untitledChat")}return he(()=>{if(!fe()){f.value=!0;return}t(!0)}),{chats:g,cursor:p,hasMore:b,isLoading:r,isCreating:o,isLoaded:f,load:t,loadMore:$,createChat:m,openChat:d,openNewChat:l,getChatTitle:L}})),Je=P({__name:"ChatListItem",props:{chat:{},title:{},isActive:{type:Boolean}},emits:["select"],setup(C,{emit:v}){const s=C,n=v,{formatTime:e}=ye(),r=c(()=>{if(s.chat.dateLastModified===null)return"";const o=new Date(s.chat.dateLastModified).getTime();return Number.isNaN(o)?"":e(o,ge.dayAndMonthShort)});return(o,f)=>(w(),T("button",{type:"button",class:a([o.$style.item,{[o.$style.active]:C.isActive}]),onClick:f[0]||(f[0]=g=>n("select"))},[h("span",{class:a(o.$style.title)},U(C.title),3),h("span",{class:a(o.$style.date)},U(r.value),3)],2))}}),et="lE8XT-AJ",tt="QYOggoVH",at="OTYdqDKq",st="BOdLbh8P",nt={item:et,active:tt,title:at,date:st,"underlay-in":"VK-hRIkY","modal-enter":"bxyUm3tU","modal-enter-slide":"w8hPNy29"},ot={$style:nt},lt=B(Je,[["__cssModules",ot]]),it=["aria-label","title"],rt=P({__name:"ChatList",props:{activeChatUuid:{}},emits:["close","select"],setup(C,{emit:v}){const s=v,{t:n}=D(),e=Z==null?void 0:Z(),r=c(()=>(e==null?void 0:e.chats.value)??[]),o=c(()=>(e==null?void 0:e.isLoading.value)===!0),f=c(()=>(e==null?void 0:e.isLoaded.value)===!0),g=c(()=>(e==null?void 0:e.hasMore.value)===!0),p=c(()=>o.value&&f.value);function b(m){return(e==null?void 0:e.getChatTitle(m))??""}function t(){var m;(m=e==null?void 0:e.loadMore)==null||m.call(e)}async function $(m){var d;s("select",m),await((d=e==null?void 0:e.openChat)==null?void 0:d.call(e,m))}return(m,d)=>(w(),T("aside",{class:a(m.$style.list)},[h("div",{class:a(m.$style.header)},[h("h2",{class:a(m.$style.title)},U(u(n)("terminal.history")),3),h("button",{type:"button",class:a(m.$style.close),"aria-label":u(n)("terminal.closeSidebar"),title:u(n)("terminal.closeSidebar"),onClick:d[0]||(d[0]=l=>s("close"))},[M(u(R),{name:"sidebar_open",width:20,height:20})],10,it)],2),o.value&&!f.value?(w(),T("div",{key:0,class:a(m.$style.loader)},[M(u(Se))],2)):r.value.length===0?(w(),T("div",{key:1,class:a(m.$style.empty)},U(u(n)("terminal.emptyChats")),3)):(w(),T("nav",se({key:2,class:m.$style.items},{[u(be)]:""}),[M(u(Ae),{class:a(m.$style.infiniteList),items:r.value,"is-loading":p.value,"is-ended":!g.value,"end-offset":"80px",onEndReach:t},{item:z(({data:l})=>[M(lt,{chat:l,title:b(l),"is-active":l.uuid===C.activeChatUuid,onSelect:L=>$(l.uuid)},null,8,["chat","title","is-active","onSelect"])]),_:1},8,["class","items","is-loading","is-ended"])],16))],2))}}),ut="FqO24ABD",ct="EISLN2KT",dt="lGWtC5Km",vt="RT0B9nzZ",mt="lx9wctzD",pt="egrlvUUi",ht="tFkiR0mm",ft="tprEl499",yt={list:ut,header:ct,title:dt,close:vt,loader:mt,empty:pt,items:ht,infiniteList:ft,"underlay-in":"OwvHsKqX","modal-enter"
1:"uRU-73kR","modal-enter-slide":"YoGig1LS"},gt={$style:yt},bt=B(rt,[["__cssModules",gt]]),ee=me((C="")=>{var I,V;const v=Ce(),s=ae(),{t:n}=D(),{alert:e,AlertType:r}=pe(),{recallAfterAuth:o}=Ee(),f=(I=oe)==null?void 0:I(),g=(V=we)==null?void 0:V(),p=A(""),b=A([]),t=A(!1),$=A(""),m=c(()=>{const y=Oe(C);return typeof y=="string"?y:""}),d=c(()=>(f==null?void 0:f.isExhausted.value)===!0),l=c(()=>p.value.trim().length===0&&b.value.length===0),L=c(()=>{if(t.value)return!0;const y=$.value.length>0?$.value:m.value;return y.length===0?!1:v.getMessages(y).some(K=>K.isPending===!0)}),_=c(()=>L.value?!1:d.value||l.value),k=c(()=>{if(L.value)return!1;const y=m.value;return(y.length>0?v.getMessages(y):[]).filter(O=>O.role==="user"&&O.isError!==!0).length===0});async function H(){await De(()=>s.currentRoute.value.query.modal).toBeUndefined({timeout:1e3,throwOnTimeout:!1}),await ce(50)}async function q(y){if(!(s.currentRoute.value.name==="TerminalChat"&&String(s.currentRoute.value.params.chatUuid)===y))try{await s.replace({name:"TerminalChat",params:{chatUuid:y}})}catch{await ce(50),await s.replace({name:"TerminalChat",params:{chatUuid:y}})}}async function W(){L.value||await o(async y=>{var O;if(!fe())throw new Ue;const K=p.value.trim(),x=b.value.map(Qe).filter(te);if(!(K.length===0&&x.length===0)){if(d.value){e({type:r.Error,text:n("terminal.tokensExhaustedTitle")});return}t.value=!0;try{p.value="",b.value=[];let S=m.value;te(S)||(S=v.createChat().uuid),$.value=S,y===!0&&await H(),await q(S),await v.sendMessage(S,K,((O=g==null?void 0:g.model)==null?void 0:O.value)??Re,x)}catch(S){console.error(S),S instanceof Error&&S.message==="ENERGY_EXHAUSTED"&&e({type:r.Error,text:n("terminal.tokensExhaustedTitle")})}finally{t.value=!1,$.value=""}}})}async function X(){const y=$.value.length>0?$.value:m.value;y.length!==0&&await v.stopStream(y)}return{text:p,uploadedAdapters:b,isSubmitting:t,isStreaming:L,isEmpty:l,isDisabled:_,isExhausted:d,isDisclaimerVisible:k,submit:W,stop:X}}),$t=["aria-label","aria-expanded","disabled"],Ct=P({__name:"ModelPicker",props:{disabled:{type:Boolean}},setup(C,{expose:v}){var $,m;const s=C,{t:n}=D(),e=($=we)==null?void 0:$(),r=(m=G)==null?void 0:m(),o=ne("root"),f=c(()=>{var d;return((d=e==null?void 0:e.selectedModel)==null?void 0:d.value.label)??n("terminal.modelLabel")}),g=c(()=>(r==null?void 0:r.isOpened.value)===!0&&r.popoverTarget.value===o.value),p=c(()=>((e==null?void 0:e.models)??Ne).map(d=>{var l;return{value:d.id,label:d.label,icon:d.icon,details:(l=e==null?void 0:e.getModelDetails)==null?void 0:l.call(e,d.id),action:()=>{e!==void 0&&(e.model.value=d.id)}}}));function b(){var l;const d=o.value;r===void 0||d===null||s.disabled===!0||r.open($e,{data:p.value,selected:(l=e==null?void 0:e.model)==null?void 0:l.value,selectable:!0,visibleOptions:p.value.length},{width:310,target:d,positionX:"right",positionY:"bottom"})}function t(d){return(r==null?void 0:r.isElementBelongToPopover(d))===!0}return v({belongsToPopover:t}),(d,l)=>(w(),T("div",{ref_key:"root",ref:o,class:a(d.$style.root)},[h("button",{type:"button",class:a(d.$style.button),"aria-label":u(n)("terminal.modelSelect"),"aria-expanded":g.value,disabled:C.disabled,onClick:b},[h("span",{class:a(d.$style.label)},U(f.value),3),M(u(Fe),{state:g.value?"b":"a"},{a:z(()=>[M(u(R),{name:"chevron_down",width:16,height:16})]),b:z(()=>[M(u(R),{name:"chevron_up",width:16,height:16})]),_:1},8,["state"])],10,$t)],2))}}),wt="AcZ-iTZN",Lt="PCYJ7F97",Mt="SG1mVgar",_t={root:wt,button:Lt,label:Mt,"underlay-in":"-uejYKsz","modal-enter":"ORJKmaR6","modal-enter-slide":"V9AbQcSv"},kt={$style:_t},Tt=B(Ct,[["__cssModules",kt]]),St=["placeholder"],At=["aria-label","title","disabled"],Et=5,Ut=P({__name:"Composer",props:{chatUuid:{}},setup(C){var re;const v=C,{t:s}=D(),n=Ye(v,"chatUuid"),e=ee==null?void 0:ee(n),r=A(null),o=(re=G)==null?void 0:re(),f=A(),g=ne("attachRoot"),p=c({get:()=>(e==null?void 0:e.text.value)??"",set:i=>{e!==void 0&&(e.text.value=i)}}),b=(e==null?void 0:e.uploadedAdapters)??A([]);function t(){var i;(i=r.value)==null||i.focus()}const{nodes:$,uploaded:m,attach:d,remove:l,isFileOverDropZone:L}=Pe({model:b,container:f,accept:".png,.jpg,.jpeg,.gif,.webp,.pdf",limit:Et,onValidated:()=>{t()},onChange:i=>{b.value=[...i]}}),{files:_,open:k,reset:H}=de({accept:".png,.jpg,.jpeg,.gif,.webp",multiple:!0}),{files:q,open:W,reset:X}=de({accept:".pdf",multiple:!0});function I(i,F){if(i===null)return;const N=Array.from(i);N.length>0&&(d==null||d(N)),F()}Y(_,i=>{I(i,H)}),Y(q,i=>{I(i,X)});const V=c(()=>(e==null?void 0:e.isSubmitting.value)===!0),y=c(()=>(e==null?void 0:e.isStreaming.value)===!0),K=c(()=>(e==null?void 0:e.isDisclaimerVisible.value)===!0),x=c(()=>($==null?void 0:$.value.length)??0),O=c(()=>x.value>
1((m==null?void 0:m.value.length)??0)),S=c(()=>y.value?!1:O.value?!0:(e==null?void 0:e.isDisabled.value)!==!1),le=c(()=>[{value:"document",label:s("terminal.attachFile"),icon:"file",action:()=>{W()}},{value:"image",label:s("terminal.attachImage"),icon:"image",action:()=>{k()}}]);function Le(){const i=r.value;i!==null&&(i.style.height="auto",i.style.height=`${i.scrollHeight}px`)}Y(p,async()=>{await Q(),Le()}),he(()=>{t()}),Y(V,async i=>{i||(await Q(),t())});function Me(i){i.shiftKey||(i.preventDefault(),ie())}function _e(){if(y.value){e==null||e.stop();return}ie()}function ie(){O.value||(e==null||e.submit(),Q(()=>{t()}))}function ke(){const i=g.value;o===void 0||i===null||y.value||o.open($e,{data:le.value,visibleOptions:le.value.length},{width:"max-content",target:i,positionX:"left",positionY:"bottom"})}return(i,F)=>(w(),T("div",{class:a(i.$style.composer)},[K.value?(w(),T("p",{key:0,class:a(i.$style.disclaimer)},U(u(s)("terminal.disclaimer")),3)):E("",!0),h("div",{ref_key:"formContainer",ref:f,class:a([i.$style.box,i.$style.expanded,{[i.$style.dropover]:u(L)}])},[h("div",{class:a(i.$style.input)},[Be(h("textarea",{ref_key:"textareaRef",ref:r,"onUpdate:modelValue":F[0]||(F[0]=N=>p.value=N),class:a(i.$style.textarea),placeholder:u(s)("terminal.placeholder"),rows:"1",onKeydown:xe(Me,["enter"])},null,42,St),[[Ke,p.value]])],2),x.value>0?(w(),T("div",{key:0,class:a(i.$style.attachments)},[(w(!0),T(Ze,null,Ie(u($),N=>(w(),j(u(ze),se({ref_for:!0},N,{key:`attachment:${N.key}`,onRemove:Fa=>{var ue;return(ue=u(l))==null?void 0:ue(N.key)}}),null,16,["onRemove"]))),128))],2)):E("",!0),h("div",{class:a(i.$style.toolbar)},[h("div",{ref_key:"attachRoot",ref:g,class:a(i.$style.attachWrap)},[h("button",{type:"button",class:a(i.$style.attach),"aria-label":u(s)("terminal.attach"),title:u(s)("terminal.attach"),disabled:y.value,onMousedown:F[1]||(F[1]=ve(()=>{},["prevent"])),onClick:ke},[M(u(R),{name:"plus",width:20,height:20})],42,At)],2),h("div",{class:a(i.$style.actions)},[h("div",{class:a(i.$style.modelGroup)},[M(Tt,{disabled:y.value},null,8,["disabled"])],2),M(u(Ve),{icon:y.value?"stop_filled":"arrow_up",size:"m","is-circle":"",disabled:S.value,class:a(i.$style.submit),"aria-label":y.value?u(s)("terminal.stop"):u(s)("terminal.send"),onMousedown:F[2]||(F[2]=ve(()=>{},["prevent"])),onClick:_e},null,8,["icon","disabled","class","aria-label"])],2)],2)],2)],2))}}),Rt="ABjjqTfN",Dt="nQiW7ORX",Ot="ps6q-Lpi",Ft="g0ZU7FlE",Nt="wQm4C1Hf",Pt="_7o4F1In2",Bt="WIukSj0z",Kt="YzqFO9Yi",xt="Munflccd",Zt="_49KezYSd",It="DZX-vAZo",zt="Uem340CZ",Vt="lyugAZG7",Yt="xM8qiS3O",jt={composer:Rt,disclaimer:Dt,box:Ot,expanded:Ft,dropover:Nt,input:Pt,textarea:Bt,toolbar:Kt,attachWrap:xt,attach:Zt,actions:It,attachments:zt,modelGroup:Vt,submit:Yt,"underlay-in":"tuUdKayD","modal-enter":"jUnIDuzC","modal-enter-slide":"lIvn2B-Q"},Gt={$style:jt},Ht=B(Ut,[["__cssModules",Gt]]),qt=P({__name:"EnergyPopover",setup(C){var p,b;const{t:v}=D(),{formatTime:s}=ye(),n=(p=oe)==null?void 0:p();(b=G)==null||b();const e=c(()=>{const t=n==null?void 0:n.energy.value;return t==null?0:Math.max(0,Math.floor(t.energyLeft))}),r=c(()=>{const t=n==null?void 0:n.energy.value;return t==null?0:Math.max(0,t.monthlyLimit-e.value)}),o=c(()=>{const t=n==null?void 0:n.energy.value;return t==null?0:Math.max(0,t.monthlyLimit)}),f=c(()=>v("terminal.energySpent",{spent:J(r.value),limit:J(o.value)})),g=c(()=>{const t=n==null?void 0:n.energy.value;return t==null||t.refreshAt<=0?"":v("terminal.energyAvailable",{limit:J(o.value),date:s(t.refreshAt*1e3,ge.Full)})});return(t,$)=>(w(),T("div",{class:a(t.$style.popover)},[M(u(R),{name:"bolt",width:24,height:24,isStatic:!0}),h("p",{class:a(t.$style.title)},U(f.value),3),g.value?(w(),T("p",{key:0,class:a(t.$style.description)},U(g.value),3)):E("",!0)],2))}}),Wt="X2PwLPLj",Xt="bHd7PGh2",Qt="a-hMstZ7",Jt="opA9ORGC",ea={popover:Wt,title:Xt,description:Qt,cta:Jt,"underlay-in":"wWcjj7sx","modal-enter":"hQsbmewf","modal-enter-slide":"-cLk0Nos"},ta={$style:ea},aa=B(qt,[["__cssModules",ta]]),sa=["aria-label","title","aria-expanded"],na=P({__name:"EnergyBalance",setup(C){var p,b;const{t:v}
1=D(),s=(p=oe)==null?void 0:p(),n=(b=G)==null?void 0:b(),e=ne("root"),r=c(()=>{const t=s==null?void 0:s.energy.value;return t==null?null:Math.max(0,Math.floor(t.energyLeft))}),o=c(()=>{const t=s==null?void 0:s.energy.value;return t==null?"":v("terminal.energy",{left:String(Math.max(0,Math.floor(t.energyLeft))),limit:String(t.monthlyLimit)})}),f=c(()=>n===void 0?!1:n.isOpened.value&&n.popoverTarget.value===e.value);function g(){const t=e.value;n===void 0||t===null||n.open(aa,{},{width:"min(382px, calc(100vw - 32px))",target:t,positionX:"right",positionY:"top"})}return(t,$)=>r.value!==null?(w(),T("button",{key:0,ref_key:"root",ref:e,type:"button",class:a(t.$style.button),"aria-label":o.value,title:o.value,"aria-expanded":f.value,onClick:g},[M(u(R),{name:"bolt",width:20,height:20,isStatic:!0}),h("span",{class:a(t.$style.value)},U(r.value),3)],10,sa)):E("",!0)}}),oa="xSSBtQzb",la="jPM8EoFU",ia={button:oa,value:la,"underlay-in":"bQ-hGJFR","modal-enter":"AxfLBH5U","modal-enter-slide":"YunWoeYT"},ra={$style:ia},ua=B(na,[["__cssModules",ra]]),ca="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20'%20viewBox='0%200%20256%20256'%3e%3cpath%20fill='%23E01E5A'%20d='M53.8412698,161.320635%20C53.8412698,176.152381%2041.8539683,188.139683%2027.0222222,188.139683%20C12.1904762,188.139683%200.203174603,176.152381%200.203174603,161.320635%20C0.203174603,146.488889%2012.1904762,134.501587%2027.0222222,134.501587%20L53.8412698,134.501587%20L53.8412698,161.320635%20Z%20M67.2507937,161.320635%20C67.2507937,146.488889%2079.2380952,134.501587%2094.0698413,134.501587%20C108.901587,134.501587%20120.888889,146.488889%20120.888889,161.320635%20L120.888889,228.368254%20C120.888889,243.2%20108.901587,255.187302%2094.0698413,255.187302%20C79.2380952,255.187302%2067.2507937,243.2%2067.2507937,228.368254%20L67.2507937,161.320635%20Z'/%3e%3cpath%20fill='%2336C5F0'%20d='M94.0698413,53.6380952%20C79.2380952,53.6380952%2067.2507937,41.6507937%2067.2507937,26.8190476%20C67.2507937,11.9873016%2079.2380952,0%2094.0698413,0%20C108.901587,0%20120.888889,11.9873016%20120.888889,26.8190476%20L120.888889,53.6380952%20L94.0698413,53.6380952%20Z%20M94.0698413,67.2507937%20C108.901587,67.2507937%20120.888889,79.2380952%20120.888889,94.0698413%20C120.888889,108.901587%20108.901587,120.888889%2094.0698413,120.888889%20L26.8190476,120.888889%20C11.9873016,120.888889%200,108.901587%200,94.0698413%20C0,79.2380952%2011.9873016,67.2507937%2026.8190476,67.2507937%20L94.0698413,67.2507937%20Z'/%3e%3cpath%20fill='%232EB67D'%20d='M201.549206,94.0698413%20C201.549206,79.2380952%20213.536508,67.2507937%20228.368254,67.2507937%20C243.2,67.2507937%20255.187302,79.2380952%20255.187302,94.0698413%20C255.187302,108.901587%20243.2,120.888889%20228.368254,120.888889%20L201.549206,120.888889%20L201.549206,94.0698413%20Z%20M188.139683,94.0698413%20C188.139683,108.901587%20176.152381,120.888889%20161.320635,120.888889%20C146.488889,120.888889%20134.501587,108.901587%20134.501587,94.0698413%20L134.501587,26.8190476%20C134.501587,11.9873016%20146.488889,0%20161.320635,0%20C176.152381,0%20188.139683,11.9873016%20188.139683,26.8190476%20L188.139683,94.0698413%20Z'/%3e%3cpath%20fill='%23ECB22E'%20d='M161.320635,201.549206%20C176.152381,201.549206%20188.139683,213.536508%20188.139683,228.368254%20C188.139683,243.2%20176.152381,255.187302%20161.320635,255.187302%20C146.488889,255.187302%20134.501587,243.2%20134.501587,228.368254%20L134.501587,201.549206%20L161.320635,201.549206%20Z%20M161.320635,188.139683%20C146.488889,188.139683%20134.501587,176.152381%20134.501587,161.320635%20C134.501587,146.488889%20146.488889,134.501587%20161.320635,134.501587%20L228.571429,134.501587%20C243.403175,134.501587%20255.390476,146.488889%20255.390476,161.320635%20C255.390476,176.152381%20243.403175,188.139683%20228.571429,188.139683%20L161.320635,188.139683%20Z'/%3e%3c/svg%3e",da=["href","aria-label","title"],va=["src"],ma=P({__name:"FeedbackButton",setup(C){const{t:v}=D(),s=te("https://cmtt-ru.slack.com/archives/C0BU5NMBJTU")?"https://cmtt-ru.slack.com/archives/C0BU5NMBJTU":void 0;return(n,e)=>u(s)?(w(),T("a",{key:0,href:u(s),class:a(n.$style.button),"aria-label":u(v)("terminal.feedback"),title:u(v)("terminal.feedback"),target:"_blank",rel:"noopener noreferrer"},[h("img",{class:a(n.$style.icon),src:u(ca),width:"15",height:"15"},null,10,va),e[0]||(e[0]=je(" gpt-bugs ",-1))],10,da)):E("",!0)}}),pa="PWPioaNa",ha="g-EWMdqt",fa={button:pa,icon:ha,"underlay-in":"BH-K-auB","modal-enter"
1:"_6c1pbKim","modal-enter-slide":"PK1utkNm"},ya={$style:fa},ga=B(ma,[["__cssModules",ya]]),ba=["aria-label","title","aria-expanded"],$a=["aria-label","title"],Ca=["aria-label","title","aria-expanded"],wa=P({__name:"Terminal",setup(C){const{t:v}=D(),s=Ge(),n=ae(),{setPageProperties:e}=He();e({title:v("terminal.seoTitle")});const r=Z==null?void 0:Z(),o=A(!1),f=c(()=>o.value?v("terminal.closeSidebar"):v("terminal.toggleSidebar")),g=c(()=>s.name==="TerminalSettings"),p=c(()=>{if(!("chatUuid"in s.params))return;const l=s.params.chatUuid;return typeof l=="string"?l:void 0}),b=c(()=>p.value!==void 0),t=c(()=>{const l=p.value;if(l===void 0||r===void 0)return;const L=r.chats.value.find(_=>_.uuid===l);if(L!==void 0)return r.getChatTitle(L)});async function $(){var l;o.value=!1,await((l=r==null?void 0:r.openNewChat)==null?void 0:l.call(r))}function m(){g.value||n.push({name:"TerminalSettings"})}function d(){o.value=!1}return(l,L)=>{const _=qe("router-view");return w(),j(u(Xe),null,{default:z(()=>[h("div",se({class:l.$style.terminal},{[u(be)]:""}),[h("header",{class:a(l.$style.header)},[h("div",{class:a(l.$style.headerLeft)},[h("button",{type:"button",class:a(l.$style.iconButton),"aria-label":f.value,title:f.value,"aria-expanded":o.value,onClick:L[0]||(L[0]=k=>o.value=!o.value)},[M(u(R),{name:"sidebar_toggle",width:20,height:20})],10,ba),t.value?(w(),T("p",{key:0,class:a(l.$style.headerTitle)},U(t.value),3)):E("",!0)],2),h("div",{class:a(l.$style.headerRight)},[M(ga),M(ua),b.value?(w(),T("button",{key:0,type:"button",class:a(l.$style.iconButton),"aria-label":u(v)("terminal.newChat"),title:u(v)("terminal.newChat"),onClick:$},[M(u(R),{name:"pen_square",width:20,height:20})],10,$a)):E("",!0),h("button",{type:"button",class:a(l.$style.iconButton),"aria-label":u(v)("terminal.settings"),title:u(v)("terminal.settings"),"aria-expanded":g.value,onClick:m},[M(u(R),{name:"settings",width:20,height:20})],10,Ca)],2)],2),h("div",{class:a(l.$style.body)},[h("div",{class:a(l.$style.main)},[M(_),g.value?E("",!0):(w(),j(Ht,{key:0,"chat-uuid":p.value},null,8,["chat-uuid"]))],2)],2),o.value?(w(),T("div",{key:0,class:a(l.$style.backdrop),onClick:L[1]||(L[1]=k=>o.value=!1)},null,2)):E("",!0),M(We,{name:"terminal-sidebar"},{default:z(()=>[o.value?(w(),j(bt,{key:0,class:a(l.$style.sidebar),"active-chat-uuid":p.value,onClose:L[2]||(L[2]=k=>o.value=!1),onSelect:d},null,8,["class","active-chat-uuid"])):E("",!0)]),_:1})],16)]),_:1})}}}),La="_1sn9AXhO",Ma="sX58jFUZ",_a="HZGj7UMs",ka="SzwgX-UL",Ta="dDaYyquK",Sa="dRW-uQVG",Aa="P1EIP1Wz",Ea="d-mnVgxU",Ua="KKF6B4dK",Ra="exKvzgHk",Da={terminal:La,header:Ma,headerLeft:_a,headerTitle:ka,headerRight:Ta,iconButton:Sa,body:Aa,backdrop:Ea,sidebar:Ua,main:Ra,"underlay-in":"cGsYpw1d","modal-enter":"FTCDPKzN","modal-enter-slide":"sP1PL9NZ"},Oa={$style:Da},xa=B(wa,[["__cssModules",Oa]]);export{xa as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.