1import{dw as A,cg as D,y as _,o as I,eL as M,r as S,v as r,eZ as w,e_ as a,eJ as N,ef as L}from"./index-DcSVvNrM.js";import{r as O,u as x}from"./index-C30mbp0T.js";const b=A(D(()=>{const s=O(),{t:i}=x(),{alert:h,AlertType:E}=_(),o=S(!1),n=S(!1),l=r(()=>s.getSettings()),c=r(()=>{const e={};for(const t of M)e[t.id]=i(w[t.id]);return e});function T(e){return c.value[e]}const u=r(()=>{var e;return((e=l.value)==null?void 0:e.instruction)??""}),d=r({get:()=>{var e;return a(((e=l.value)==null?void 0:e.defaultModel)??N).id},set:e=>{m({model:e,instruction:u.value}).catch(()=>{})}}),p=r(()=>a(d.value));async function v(){if(L()){o.value=!0;try{await s.refreshSettings()}catch(e){console.error(e)}finally{o.value=!1}}}let f=Promise.resolve();async function m(e){if(!L())return;const t=async()=>{n.value=!0;try{await s.saveSettings({defaultModel:a(e.model).id,instruction:e.instruction.trim()})}catch(y){throw console.error(y),h({type:E.Error,text:i("terminal.errorSaveSettings")}),y}finally{n.value=!1}},g=f.then(t,t);return f=g.then(()=>{},()=>{}),g}return I(()=>{v()}),{model:d,instruction:u,selectedModel:p,models:M,modelDetailsById:c,getModelDetails:T,isLoading:o,isSaving:n,refresh:v,save:m}}));export{b as u};
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.