@kilocode/cli-darwin-arm64 7.4.22 → 7.4.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,7 +17,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA
|
|
|
17
17
|
|
|
18
18
|
`);v=x.pop()??"";for(const S of x){const G=S.split(`
|
|
19
19
|
`),K=[];let q;for(const j of G)if(j.startsWith("data:"))K.push(j.replace(/^data:\s*/,""));else if(j.startsWith("event:"))q=j.replace(/^event:\s*/,"");else if(j.startsWith("id:"))g=j.replace(/^id:\s*/,"");else if(j.startsWith("retry:")){const oA=Number.parseInt(j.replace(/^retry:\s*/,""),10);Number.isNaN(oA)||(C=oA)}let J,P=!1;if(K.length){const j=K.join(`
|
|
20
|
-
`);try{J=JSON.parse(j),P=!0}catch{J=j}}P&&(i&&await i(J),n&&(J=await n(J))),t?.({data:J,event:q,id:g,retry:C}),K.length&&(yield J)}}}finally{f.removeEventListener("abort",N),M.releaseLock()}break}catch(p){if(e?.(p),o!==void 0&&I>=o)break;const w=Math.min(C*2**(I-1),s??3e4);await d(w)}}}()}},y2=A=>{switch(A){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},D2=A=>{switch(A){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},k2=A=>{switch(A){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},VC=({allowReserved:A,explode:e,name:t,style:n,value:i})=>{if(!e){const s=(A?i:i.map(a=>encodeURIComponent(a))).join(D2(n));switch(n){case"label":return`.${s}`;case"matrix":return`;${t}=${s}`;case"simple":return s;default:return`${t}=${s}`}}const r=y2(n),o=i.map(s=>n==="label"||n==="simple"?A?s:encodeURIComponent(s):fa({allowReserved:A,name:t,value:s})).join(r);return n==="label"||n==="matrix"?r+o:o},fa=({allowReserved:A,name:e,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${A?t:encodeURIComponent(t)}`},jC=({allowReserved:A,explode:e,name:t,style:n,value:i,valueOnly:r})=>{if(i instanceof Date)return r?i.toISOString():`${t}=${i.toISOString()}`;if(n!=="deepObject"&&!e){let a=[];Object.entries(i).forEach(([c,g])=>{a=[...a,c,A?g:encodeURIComponent(g)]});const l=a.join(",");switch(n){case"form":return`${t}=${l}`;case"label":return`.${l}`;case"matrix":return`;${t}=${l}`;default:return l}}const o=k2(n),s=Object.entries(i).map(([a,l])=>fa({allowReserved:A,name:n==="deepObject"?`${t}[${a}]`:a,value:l})).join(o);return n==="label"||n==="matrix"?o+s:s},b2=/\{[^{}]+\}/g,v2=({path:A,url:e})=>{let t=e;const n=e.match(b2);if(n)for(const i of n){let r=!1,o=i.substring(1,i.length-1),s="simple";o.endsWith("*")&&(r=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),s="label"):o.startsWith(";")&&(o=o.substring(1),s="matrix");const a=A[o];if(a==null)continue;if(Array.isArray(a)){t=t.replace(i,VC({explode:r,name:o,style:s,value:a}));continue}if(typeof a=="object"){t=t.replace(i,jC({explode:r,name:o,style:s,value:a,valueOnly:!0}));continue}if(s==="matrix"){t=t.replace(i,`;${fa({name:o,value:a})}`);continue}const l=encodeURIComponent(s==="label"?`.${a}`:a);t=t.replace(i,l)}return t},M2=({baseUrl:A,path:e,query:t,querySerializer:n,url:i})=>{const r=i.startsWith("/")?i:`/${i}`;let o=(A??"")+r;e&&(o=v2({path:e,url:o}));let s=t?n(t):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function Pd(A){const e=A.body!==void 0;if(e&&A.bodySerializer)return"serializedBody"in A?A.serializedBody!==void 0&&A.serializedBody!==""?A.serializedBody:null:A.body!==""?A.body:null;if(e)return A.body}const N2=async(A,e)=>{const t=typeof e=="function"?await e(A):e;if(t)return A.scheme==="bearer"?`Bearer ${t}`:A.scheme==="basic"?`Basic ${btoa(t)}`:t},S2={bodySerializer:A=>JSON.stringify(A,(e,t)=>typeof t=="bigint"?t.toString():t)},zC=({parameters:A={},...e}={})=>n=>{const i=[];if(n&&typeof n=="object")for(const r in n){const o=n[r];if(o==null)continue;const s=A[r]||e;if(Array.isArray(o)){const a=VC({allowReserved:s.allowReserved,explode:!0,name:r,style:"form",value:o,...s.array});a&&i.push(a)}else if(typeof o=="object"){const a=jC({allowReserved:s.allowReserved,explode:!0,name:r,style:"deepObject",value:o,...s.object});a&&i.push(a)}else{const a=fa({allowReserved:s.allowReserved,name:r,value:o});a&&i.push(a)}}return i.join("&")},x2=A=>{if(!A)return"stream";const e=A.split(";")[0]?.trim();if(e){if(e.startsWith("application/json")||e.endsWith("+json"))return"json";if(e==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>e.startsWith(t)))return"blob";if(e.startsWith("text/"))return"text"}},L2=(A,e)=>e?!!(A.headers.has(e)||A.query?.[e]||A.headers.get("Cookie")?.includes(`${e}=`)):!1,_2=async({security:A,...e})=>{for(const t of A){if(L2(e,t.name))continue;const n=await N2(t,e.auth);if(!n)continue;const i=t.name??"Authorization";switch(t.in){case"query":e.query||(e.query={}),e.query[i]=n;break;case"cookie":e.headers.append("Cookie",`${i}=${n}`);break;default:e.headers.set(i,n);break}}},Vd=A=>M2({baseUrl:A.baseUrl,path:A.path,query:A.query,querySerializer:typeof A.querySerializer=="function"?A.querySerializer:zC(A.querySerializer),url:A.url}),jd=(A,e)=>{const t={...A,...e};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=$C(A.headers,e.headers),t},F2=A=>{const e=[];return A.forEach((t,n)=>{e.push([n,t])}),e},$C=(...A)=>{const e=new Headers;for(const t of A){if(!t)continue;const n=t instanceof Headers?F2(t):Object.entries(t);for(const[i,r]of n)if(r===null)e.delete(i);else if(Array.isArray(r))for(const o of r)e.append(i,o);else r!==void 0&&e.set(i,typeof r=="object"?JSON.stringify(r):r)}return e};class ul{fns=[];clear(){this.fns=[]}eject(e){const t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){const t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e=="number"?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){const n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}}const G2=()=>({error:new ul,request:new ul,response:new ul}),R2=zC({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),U2={"Content-Type":"application/json"},WC=(A={})=>({...S2,headers:U2,parseAs:"auto",querySerializer:R2,...A}),ZC=(A={})=>{let e=jd(WC(),A);const t=()=>({...e}),n=l=>(e=jd(e,l),t()),i=G2(),r=async l=>{const c={...e,...l,fetch:l.fetch??e.fetch??globalThis.fetch,headers:$C(e.headers,l.headers),serializedBody:void 0};c.security&&await _2({...c,security:c.security}),c.requestValidator&&await c.requestValidator(c),c.body!==void 0&&c.bodySerializer&&(c.serializedBody=c.bodySerializer(c.body)),(c.body===void 0||c.serializedBody==="")&&c.headers.delete("Content-Type");const g=Vd(c);return{opts:c,url:g}},o=async l=>{const{opts:c,url:g}=await r(l),d={redirect:"follow",...c,body:Pd(c)};let Q=new Request(g,d);for(const m of i.request.fns)m&&(Q=await m(Q,c));const B=c.fetch;let C;try{C=await B(Q)}catch(m){let y=m;for(const M of i.error.fns)M&&(y=await M(m,void 0,Q,c));if(y=y||{},c.throwOnError)throw y;return c.responseStyle==="data"?void 0:{error:y,request:Q,response:void 0}}for(const m of i.response.fns)m&&(C=await m(C,Q,c));const I={request:Q,response:C};if(C.ok){const m=(c.parseAs==="auto"?x2(C.headers.get("Content-Type")):c.parseAs)??"json";if(C.status===204||C.headers.get("Content-Length")==="0"){let M;switch(m){case"arrayBuffer":case"blob":case"text":M=await C[m]();break;case"formData":M=new FormData;break;case"stream":M=C.body;break;default:M={};break}return c.responseStyle==="data"?M:{data:M,...I}}let y;switch(m){case"arrayBuffer":case"blob":case"formData":case"text":y=await C[m]();break;case"json":{const M=await C.text();y=M?JSON.parse(M):{};break}case"stream":return c.responseStyle==="data"?C.body:{data:C.body,...I}}return m==="json"&&(c.responseValidator&&await c.responseValidator(y),c.responseTransformer&&(y=await c.responseTransformer(y))),c.responseStyle==="data"?y:{data:y,...I}}const f=await C.text();let u;try{u=JSON.parse(f)}catch{}const p=u??f;let w=p;for(const m of i.error.fns)m&&(w=await m(p,C,Q,c));if(w=w||{},c.throwOnError)throw w;return c.responseStyle==="data"?void 0:{error:w,...I}},s=l=>c=>o({...c,method:l}),a=l=>async c=>{const{opts:g,url:d}=await r(c);return w2({...g,body:g.body,headers:g.headers,method:l,onRequest:async(Q,B)=>{let C=new Request(Q,B);for(const I of i.request.fns)I&&(C=await I(C,g));return C},serializedBody:Pd(g),url:d})};return{buildUrl:Vd,connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:t,head:s("HEAD"),interceptors:i,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:o,setConfig:n,sse:{connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),head:a("HEAD"),options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),trace:a("TRACE")},trace:s("TRACE")}},T2={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},O2=Object.entries(T2),XC=(A,e)=>{e||(e=new Map);for(const t of A)"in"in t?t.key&&e.set(t.key,{in:t.in,map:t.map}):"key"in t?e.set(t.key,{map:t.map}):t.args&&XC(t.args,e);return e},K2=A=>{for(const[e,t]of Object.entries(A))t&&typeof t=="object"&&!Object.keys(t).length&&delete A[e]},L=(A,e)=>{const t={body:{},headers:{},path:{},query:{}},n=XC(e);let i;for(const[r,o]of A.entries())if(e[r]&&(i=e[r]),!!i)if("in"in i)if(i.key){const s=n.get(i.key),a=s.map||i.key;s.in&&(t[s.in][a]=o)}else t.body=o;else for(const[s,a]of Object.entries(o??{})){const l=n.get(s);if(l)if(l.in){const c=l.map||s;t[l.in][c]=a}else t[l.map]=a;else{const c=O2.find(([g])=>s.startsWith(g));if(c){const[g,d]=c;t[d][s.slice(g.length)]=a}else if("allowExtra"in i&&i.allowExtra){for(const[g,d]of Object.entries(i.allowExtra))if(d){t[g][s]=a;break}}}}return K2(t),t},q2=ZC(WC({baseUrl:"http://localhost:4096"}));class AA{client;constructor(e){this.client=e?.client??q2}}class J2{defaultKey="default";instances=new Map;get(e){const t=this.instances.get(e??this.defaultKey);if(!t)throw new Error('No SDK client found. Create one with "new KiloClient()" to fix this error.');return t}set(e,t){this.instances.set(t??this.defaultKey,e)}}class H2 extends AA{remove(e,t){const n=L([e],[{args:[{in:"path",key:"providerID"}]}]);return(t?.client??this.client).delete({url:"/auth/{providerID}",...t,...n})}set(e,t){const n=L([e],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return(t?.client??this.client).put({url:"/auth/{providerID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}let Y2=class extends AA{log(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return(t?.client??this.client).post({url:"/log",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}agents(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/agent",...t,...n})}skills(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/skill",...t,...n})}};class P2 extends AA{moveSession(e,t){const n=L([e],[{args:[{in:"body",key:"sessionID"},{in:"body",key:"destination"},{in:"body",key:"moveChanges"}]}]);return(t?.client??this.client).post({url:"/experimental/control-plane/move-session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class V2 extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/capabilities",...t,...n})}}class j2 extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/console",...t,...n})}listOrgs(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/console/orgs",...t,...n})}switchOrg(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"accountID"},{in:"body",key:"orgID"}]}]);return(t?.client??this.client).post({url:"/experimental/console/switch",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class z2 extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"projectID"},{in:"query",key:"worktrees"},{in:"query",key:"current"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"cursor"},{in:"query",key:"search"},{in:"query",key:"limit"},{in:"query",key:"archived"}]}]);return(t?.client??this.client).get({url:"/experimental/session",...t,...n})}background(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/experimental/session/{sessionID}/background",...t,...n})}}class $2 extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/resource",...t,...n})}}class W2 extends AA{generateName(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"context"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy/generate-name",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Z2 extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace/adapter",...t,...n})}}class X2 extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"type"},{in:"body",key:"branch"},{in:"body",key:"extra"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}syncList(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace/sync-list",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace/status",...t,...n})}remove(e,t){const n=L([e],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/experimental/workspace/{id}",...t,...n})}warp(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"sessionID"},{in:"body",key:"copyChanges"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace/warp",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_adapter;get adapter(){return this._adapter??=new Z2({client:this.client})}}class AD extends AA{_controlPlane;get controlPlane(){return this._controlPlane??=new P2({client:this.client})}_capabilities;get capabilities(){return this._capabilities??=new V2({client:this.client})}_console;get console(){return this._console??=new j2({client:this.client})}_session;get session(){return this._session??=new z2({client:this.client})}_resource;get resource(){return this._resource??=new $2({client:this.client})}_projectCopy;get projectCopy(){return this._projectCopy??=new W2({client:this.client})}_workspace;get workspace(){return this._workspace??=new X2({client:this.client})}}class eD extends AA{get(e){return(e?.client??this.client).get({url:"/global/config",...e})}update(e,t){const n=L([e],[{args:[{key:"config",map:"body"}]}]);return(t?.client??this.client).patch({url:"/global/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class tD extends AA{health(e){return(e?.client??this.client).get({url:"/global/health",...e})}event(e){return(e?.client??this.client).sse.get({url:"/global/event",...e})}dispose(e){return(e?.client??this.client).post({url:"/global/dispose",...e})}upgrade(e,t){const n=L([e],[{args:[{in:"body",key:"target"}]}]);return(t?.client??this.client).post({url:"/global/upgrade",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_config;get config(){return this._config??=new eD({client:this.client})}}let nD=class extends AA{subscribe(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).sse.get({url:"/event",...t,...n})}};class iD extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"config",map:"body"}]}]);return(t?.client??this.client).patch({url:"/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}warnings(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/warnings",...t,...n})}providers(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/providers",...t,...n})}overlay(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"}]}]);return(t?.client??this.client).get({url:"/config/overlay",...t,...n})}overlayUpdate(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"scope"},{in:"body",key:"set"},{in:"body",key:"unset"},{in:"body",key:"expected"}]}]);return(t?.client??this.client).patch({url:"/config/overlay",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}sources(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/sources",...t,...n})}effective(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/effective",...t,...n})}rules(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"}]}]);return(t?.client??this.client).get({url:"/config/rules",...t,...n})}rulesUpdate(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"scope"},{in:"body",key:"content"}]}]);return(t?.client??this.client).put({url:"/config/rules",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}modelState(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/model-state",...t,...n})}modelStateUpdate(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"favorite"}]}]);return(t?.client??this.client).patch({url:"/config/model-state",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class rD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return(t?.client??this.client).get({url:"/experimental/tool",...t,...n})}ids(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/tool/ids",...t,...n})}}class oD extends AA{remove(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeRemoveInput",map:"body"}]}]);return(t?.client??this.client).delete({url:"/experimental/worktree",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeCreateInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/experimental/worktree",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reset(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeResetInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/experimental/worktree/reset",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}diff(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff",...t,...n})}diffSummary(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff/summary",...t,...n})}diffFile(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"},{in:"query",key:"file"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff/file",...t,...n})}}class sD extends AA{text(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"pattern"}]}]);return(t?.client??this.client).get({url:"/find",...t,...n})}files(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/find/file",...t,...n})}symbols(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"}]}]);return(t?.client??this.client).get({url:"/find/symbol",...t,...n})}}let aD=class extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/file",...t,...n})}read(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/file/content",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/file/status",...t,...n})}};class lD extends AA{dispose(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/instance/dispose",...t,...n})}reload(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/instance/reload",...t,...n})}}class gD extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/path",...t,...n})}}let cD=class extends AA{raw(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs/diff/raw",...t,...n})}};class dD extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs/status",...t,...n})}diff(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"mode"},{in:"query",key:"context"}]}]);return(t?.client??this.client).get({url:"/vcs/diff",...t,...n})}apply(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"patch"}]}]);return(t?.client??this.client).post({url:"/vcs/apply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_diff;get diff2(){return this._diff??=new cD({client:this.client})}}class QD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/command",...t,...n})}}class BD extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/lsp",...t,...n})}}class ED extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/formatter",...t,...n})}}class CD extends AA{remove(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/mcp/{name}/auth",...t,...n})}start(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth",...t,...n})}callback(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth/callback",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}authenticate(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...t,...n})}}class uD extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/mcp",...t,...n})}add(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return(t?.client??this.client).post({url:"/mcp",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connect(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/connect",...t,...n})}disconnect(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/disconnect",...t,...n})}_auth;get auth(){return this._auth??=new CD({client:this.client})}}class hD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project",...t,...n})}current(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project/current",...t,...n})}initGit(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/project/git/init",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return(t?.client??this.client).patch({url:"/project/{projectID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}directories(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project/{projectID}/directories",...t,...n})}}class ID extends AA{shells(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty/shells",...t,...n})}list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"},{in:"body",key:"size"}]}]);return(t?.client??this.client).post({url:"/pty",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}remove(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/pty/{ptyID}",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty/{ptyID}",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"size"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).put({url:"/pty/{ptyID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connectToken(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/pty/{ptyID}/connect-token",...t,...n})}connect(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"cursor"},{in:"query",key:"ticket"}]}]);return(t?.client??this.client).get({url:"/pty/{ptyID}/connect",...t,...n})}}class fD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/question",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"answers"}]}]);return(t?.client??this.client).post({url:"/question/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/question/{requestID}/reject",...t,...n})}}class pD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/permission",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"reply"},{in:"body",key:"message"},{in:"body",key:"interactive"}]}]);return(t?.client??this.client).post({url:"/permission/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}saveAlwaysRules(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"approvedAlways"},{in:"body",key:"deniedAlways"}]}]);return(t?.client??this.client).post({url:"/permission/{requestID}/always-rules",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}allowEverything(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enable"},{in:"body",key:"requestID"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/permission/allow-everything",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}respond(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"response"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class mD extends AA{authorize(e,t){const n=L([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"inputs"}]}]);return(t?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}callback(e,t){const n=L([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class wD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/provider",...t,...n})}auth(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/provider/auth",...t,...n})}_oauth;get oauth(){return this._oauth??=new mD({client:this.client})}}class yD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"},{in:"query",key:"path"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/session",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"parentID"},{in:"body",key:"title"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"metadata"},{in:"body",key:"permission"},{in:"body",key:"platform"},{in:"body",key:"workspaceID"},{in:"body",key:"sandboxInheritanceToken"}]}]);return(t?.client??this.client).post({url:"/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/status",...t,...n})}delete(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"metadata"},{in:"body",key:"permission"},{in:"body",key:"time"}]}]);return(t?.client??this.client).patch({url:"/session/{sessionID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}children(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/children",...t,...n})}todo(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/todo",...t,...n})}diff(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"messageID"},{in:"query",key:"file"},{in:"query",key:"full"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/diff",...t,...n})}messages(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"limit"},{in:"query",key:"before"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/message",...t,...n})}prompt(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"editorContext"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}deleteMessage(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}",...t,...n})}message(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...t,...n})}fork(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/fork",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}abort(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/abort",...t,...n})}init(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/init",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}unshare(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/share",...t,...n})}share(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/share",...t,...n})}summarize(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/summarize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}promptAsync(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"editorContext"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}command(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"arguments"},{in:"body",key:"command"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/command",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}shell(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"command"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/shell",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}revert(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/revert",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}unrevert(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/unrevert",...t,...n})}viewed(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"viewer"},{in:"body",key:"attached"},{in:"body",key:"visible"}]}]);return(t?.client??this.client).post({url:"/session/viewed",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class DD extends AA{delete(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"part",map:"body"}]}]);return(t?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class kD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/sync/history",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class bD extends AA{start(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/sync/start",...t,...n})}replay(e,t){const n=L([e],[{args:[{in:"query",key:"query_directory",map:"directory"},{in:"query",key:"workspace"},{in:"body",key:"body_directory",map:"directory"},{in:"body",key:"events"}]}]);return(t?.client??this.client).post({url:"/sync/replay",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}steal(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/sync/steal",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_history;get history(){return this._history??=new kD({client:this.client})}}class vD extends AA{next(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/control/next",...t,...n})}response(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/tui/control/response",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class MD extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/config",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"},{in:"body",key:"$schema"},{in:"body",key:"theme"},{in:"body",key:"keybinds"},{in:"body",key:"plugin"},{in:"body",key:"plugin_enabled"},{in:"body",key:"title_icon"},{in:"body",key:"scroll_speed"},{in:"body",key:"scroll_acceleration"},{in:"body",key:"diff_style"},{in:"body",key:"mouse"},{in:"body",key:"attention"}]}]);return(t?.client??this.client).patch({url:"/tui/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class ND extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/keybinds",...t,...n})}}class SD extends AA{appendPrompt(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"}]}]);return(t?.client??this.client).post({url:"/tui/append-prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}openHelp(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-help",...t,...n})}openSessions(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-sessions",...t,...n})}openThemes(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-themes",...t,...n})}openModels(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-models",...t,...n})}submitPrompt(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/submit-prompt",...t,...n})}clearPrompt(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/clear-prompt",...t,...n})}executeCommand(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"}]}]);return(t?.client??this.client).post({url:"/tui/execute-command",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}showToast(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return(t?.client??this.client).post({url:"/tui/show-toast",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}publish(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/tui/publish",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}selectSession(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/tui/select-session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_control;get control(){return this._control??=new vD({client:this.client})}_config;get config(){return this._config??=new MD({client:this.client})}_keybind;get keybind(){return this._keybind??=new ND({client:this.client})}}class xD extends AA{preview(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"scope"},{in:"body",key:"description"},{in:"body",key:"mode"},{in:"body",key:"model"},{in:"body",key:"color"},{in:"body",key:"steps"},{in:"body",key:"tools"},{in:"body",key:"permission"},{in:"body",key:"prompt"}]}]);return(t?.client??this.client).post({url:"/agent-builder/preview",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}save(e,t){const n=L([e],[{args:[{in:"path",key:"path_id",map:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"body_id",map:"id"},{in:"body",key:"scope"},{in:"body",key:"description"},{in:"body",key:"mode"},{in:"body",key:"model"},{in:"body",key:"color"},{in:"body",key:"steps"},{in:"body",key:"tools"},{in:"body",key:"permission"},{in:"body",key:"prompt"}]}]);return(t?.client??this.client).put({url:"/agent-builder/{id}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class LD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process/{processID}",...t,...n})}logs(e,t){const n=L([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process/{processID}/logs",...t,...n})}stop(e,t){const n=L([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/{processID}/stop",...t,...n})}restart(e,t){const n=L([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/{processID}/restart",...t,...n})}stopSession(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/session/{sessionID}/stop",...t,...n})}}class _D extends AA{generate(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"prompt"},{in:"body",key:"providerID"},{in:"body",key:"modelID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/branch-name",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class FD extends AA{generate(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"path"},{in:"body",key:"selectedFiles"},{in:"body",key:"previousMessage"},{in:"body",key:"language"}]}]);return(t?.client??this.client).post({url:"/commit-message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class GD extends AA{enhance(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"}]}]);return(t?.client??this.client).post({url:"/enhance-prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class RD extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/status",...t,...n})}warnings(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/warnings",...t,...n})}models(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/models",...t,...n})}consent(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enabled"}]}]);return(t?.client??this.client).put({url:"/indexing/consent",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class UD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/interactive-terminal",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/interactive-terminal/{terminalID}",...t,...n})}write(e,t){const n=L([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"interactiveTerminalWriteInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/input",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}resize(e,t){const n=L([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"interactiveTerminalResizeInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/resize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}close(e,t){const n=L([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/close",...t,...n})}}class TD extends AA{transcriptions(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"model"},{in:"body",key:"input_audio"},{in:"body",key:"language"},{in:"body",key:"prompt"},{in:"body",key:"temperature"}]}]);return(t?.client??this.client).post({url:"/kilo/audio/transcriptions",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class OD extends AA{images(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/models/images",...t,...n})}transcriptions(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/models/transcriptions",...t,...n})}}class KD extends AA{set(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"organizationId"}]}]);return(t?.client??this.client).post({url:"/kilo/organization",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class qD extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/claw/status",...t,...n})}chatCredentials(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/claw/chat-credentials",...t,...n})}}class JD extends AA{get(e,t){const n=L([e],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/cloud/session/{id}",...t,...n})}import(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionId"}]}]);return(t?.client??this.client).post({url:"/kilo/cloud/session/import",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class HD extends AA{_session;get session(){return this._session??=new JD({client:this.client})}}class YD extends AA{profile(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/profile",...t,...n})}authStatus(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/auth-status",...t,...n})}modes(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/modes",...t,...n})}fim(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"prefix"},{in:"body",key:"suffix"},{in:"body",key:"provider"},{in:"body",key:"model"},{in:"body",key:"maxTokens"},{in:"body",key:"temperature"}]}]);return(t?.client??this.client).sse.post({url:"/kilo/fim",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}edit(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"provider"},{in:"body",key:"model"},{in:"body",key:"maxTokens"},{in:"body",key:"currentFilePath"},{in:"body",key:"currentFileContent"},{in:"body",key:"cursorLine"},{in:"body",key:"cursorCharacter"},{in:"body",key:"editableRegionStartLine"},{in:"body",key:"editableRegionEndLine"},{in:"body",key:"recentlyViewedSnippets"},{in:"body",key:"editDiffHistory"}]}]);return(t?.client??this.client).post({url:"/kilo/edit",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}notifications(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/notifications",...t,...n})}cloudSessions(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"cursor"},{in:"query",key:"limit"},{in:"query",key:"gitUrl"}]}]);return(t?.client??this.client).get({url:"/kilo/cloud-sessions",...t,...n})}_audio;get audio(){return this._audio??=new TD({client:this.client})}_models;get models(){return this._models??=new OD({client:this.client})}_organization;get organization(){return this._organization??=new KD({client:this.client})}_claw;get claw(){return this._claw??=new qD({client:this.client})}_cloud;get cloud(){return this._cloud??=new HD({client:this.client})}}class PD extends AA{snapshot(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/kilocode/heap/snapshot",...t,...n})}}class VD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/notebook",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"result"}]}]);return(t?.client??this.client).post({url:"/kilocode/notebook/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"error"}]}]);return(t?.client??this.client).post({url:"/kilocode/notebook/{requestID}/reject",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class jD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/agent-manager",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"result"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent-manager/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"error"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent-manager/{requestID}/reject",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class zD extends AA{project(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"worktree"},{in:"body",key:"vcs"},{in:"body",key:"name"},{in:"body",key:"iconUrl"},{in:"body",key:"iconColor"},{in:"body",key:"timeCreated"},{in:"body",key:"timeUpdated"},{in:"body",key:"timeInitialized"},{in:"body",key:"sandboxes"},{in:"body",key:"commands"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/project",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}session(e,t){const n=L([e],[{args:[{in:"query",key:"query_directory",map:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"projectID"},{in:"body",key:"force"},{in:"body",key:"workspaceID"},{in:"body",key:"parentID"},{in:"body",key:"slug"},{in:"body",key:"body_directory",map:"directory"},{in:"body",key:"title"},{in:"body",key:"version"},{in:"body",key:"shareURL"},{in:"body",key:"summary"},{in:"body",key:"revert"},{in:"body",key:"permission"},{in:"body",key:"timeCreated"},{in:"body",key:"timeUpdated"},{in:"body",key:"timeCompacting"},{in:"body",key:"timeArchived"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}message(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"sessionID"},{in:"body",key:"timeCreated"},{in:"body",key:"data"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}part(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"messageID"},{in:"body",key:"sessionID"},{in:"body",key:"timeCreated"},{in:"body",key:"data"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/part",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class $D extends AA{agentRequirements(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"agent"}]}]);return(t?.client??this.client).get({url:"/kilocode/agent/requirements",...t,...n})}commandFiles(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/command/files",...t,...n})}removeCommand(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"location"}]}]);return(t?.client??this.client).post({url:"/kilocode/command/remove",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}removeSkill(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"location"}]}]);return(t?.client??this.client).post({url:"/kilocode/skill/remove",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}removeAgent(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent/remove",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}sessionModelUsage(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/model-usage",...t,...n})}_heap;get heap(){return this._heap??=new PD({client:this.client})}_notebook;get notebook(){return this._notebook??=new VD({client:this.client})}_agentManager;get agentManager(){return this._agentManager??=new jD({client:this.client})}_sessionImport;get sessionImport(){return this._sessionImport??=new zD({client:this.client})}}class WD extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/anaconda-desktop/status",...t,...n})}open(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/kilocode/anaconda-desktop/open",...t,...n})}sync(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"acknowledgeToolLimitations"}]}]);return(t?.client??this.client).post({url:"/kilocode/anaconda-desktop/sync",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class ZD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/network",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/network/{requestID}/reply",...t,...n})}reject(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/network/{requestID}/reject",...t,...n})}}class XD extends AA{enable(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/remote/enable",...t,...n})}disable(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/remote/disable",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/remote/status",...t,...n})}}class Ak extends AA{support(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/sandbox/support",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/sandbox",...t,...n})}toggle(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/sandbox/toggle",...t,...n})}}class ek extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/suggestion",...t,...n})}accept(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"index"}]}]);return(t?.client??this.client).post({url:"/suggestion/{requestID}/accept",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}dismiss(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/suggestion/{requestID}/dismiss",...t,...n})}}class tk extends AA{capture(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"event"},{in:"body",key:"properties"}]}]);return(t?.client??this.client).post({url:"/telemetry/capture",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}setEnabled(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enabled"}]}]);return(t?.client??this.client).post({url:"/telemetry/setEnabled",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class nk extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/memory/status",...t,...n})}show(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/memory/show",...t,...n})}enable(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/enable",...t,...n})}disable(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/disable",...t,...n})}configure(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"autoConsolidate"},{in:"body",key:"verbose"}]}]);return(t?.client??this.client).post({url:"/memory/configure",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}rebuild(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/rebuild",...t,...n})}remember(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"},{in:"body",key:"key"},{in:"body",key:"file"},{in:"body",key:"section"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/remember",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}correct(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"},{in:"body",key:"key"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/correct",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}forget(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"query"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/forget",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}purge(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"confirm"}]}]);return(t?.client??this.client).post({url:"/memory/purge",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class ik extends AA{get(e){return(e?.client??this.client).get({url:"/api/health",...e})}}class rk extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/location",...t,...n})}}class ok extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/agent",...t,...n})}}class sk extends AA{stage(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"messageID"},{in:"body",key:"files"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/revert/stage",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}clear(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/revert/clear",...t,...n})}commit(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/revert/commit",...t,...n})}}class ak extends AA{list(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/permission",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"id"},{in:"body",key:"action"},{in:"body",key:"resources"},{in:"body",key:"save"},{in:"body",key:"metadata"},{in:"body",key:"source"},{in:"body",key:"agent"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/permission",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}get(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/permission/{requestID}",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/permission/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class lk extends AA{list(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/question",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"},{key:"questionV2Reply",map:"body"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/question/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/question/{requestID}/reject",...t,...n})}}class gk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"workspace"},{in:"query",key:"limit"},{in:"query",key:"order"},{in:"query",key:"search"},{in:"query",key:"directory"},{in:"query",key:"project"},{in:"query",key:"subpath"},{in:"query",key:"cursor"}]}]);return(t?.client??this.client).get({url:"/api/session",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"body",key:"id"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"location"}]}]);return(t?.client??this.client).post({url:"/api/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}active(e){return(e?.client??this.client).get({url:"/api/session/active",...e})}get(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}",...t,...n})}switchAgent(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"agent"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/agent",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}switchModel(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"model"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/model",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}prompt(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"id"},{in:"body",key:"prompt"},{in:"body",key:"delivery"},{in:"body",key:"resume"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}compact(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/compact",...t,...n})}wait(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/wait",...t,...n})}context(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/context",...t,...n})}history(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"limit"},{in:"query",key:"after"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/history",...t,...n})}events(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"after"}]}]);return(t?.client??this.client).sse.get({url:"/api/session/{sessionID}/event",...t,...n})}interrupt(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/interrupt",...t,...n})}message(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/message/{messageID}",...t,...n})}messages(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"limit"},{in:"query",key:"order"},{in:"query",key:"cursor"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/message",...t,...n})}_revert;get revert(){return this._revert??=new sk({client:this.client})}_permission;get permission(){return this._permission??=new ak({client:this.client})}_question;get question(){return this._question??=new lk({client:this.client})}}class ck extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/model",...t,...n})}}class dk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/provider",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/provider/{providerID}",...t,...n})}}class Qk extends AA{key(e,t){const n=L([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"},{in:"body",key:"key"},{in:"body",key:"label"}]}]);return(t?.client??this.client).post({url:"/api/integration/{integrationID}/connect/key",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}oauth(e,t){const n=L([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"},{in:"body",key:"methodID"},{in:"body",key:"inputs"},{in:"body",key:"label"}]}]);return(t?.client??this.client).post({url:"/api/integration/{integrationID}/connect/oauth",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Bk extends AA{cancel(e,t){const n=L([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/integration/attempt/{attemptID}",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration/attempt/{attemptID}",...t,...n})}complete(e,t){const n=L([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/api/integration/attempt/{attemptID}/complete",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Ek extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration/{integrationID}",...t,...n})}_connect;get connect(){return this._connect??=new Qk({client:this.client})}_attempt;get attempt(){return this._attempt??=new Bk({client:this.client})}}class Ck extends AA{remove(e,t){const n=L([e],[{args:[{in:"path",key:"credentialID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/credential/{credentialID}",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"credentialID"},{in:"query",key:"location"},{in:"body",key:"label"}]}]);return(t?.client??this.client).patch({url:"/api/credential/{credentialID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}let uk=class extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/permission/request",...t,...n})}};class hk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"projectID"}]}]);return(t?.client??this.client).get({url:"/api/permission/saved",...t,...n})}remove(e,t){const n=L([e],[{args:[{in:"path",key:"id"}]}]);return(t?.client??this.client).delete({url:"/api/permission/saved/{id}",...t,...n})}}class Ik extends AA{_request;get request(){return this._request??=new uk({client:this.client})}_saved;get saved(){return this._saved??=new hk({client:this.client})}}class fk extends AA{read(e,t){const n=L([e],[{args:[{in:"query",key:"location"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/api/fs/read/*",...t,...n})}list(e,t){const n=L([e],[{args:[{in:"query",key:"location"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/api/fs/list",...t,...n})}find(e,t){const n=L([e],[{args:[{in:"query",key:"location"},{in:"query",key:"query"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/api/fs/find",...t,...n})}}class pk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/command",...t,...n})}}class mk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/skill",...t,...n})}}class wk extends AA{subscribe(e){return(e?.client??this.client).sse.get({url:"/api/event",...e})}}class yk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/pty",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"query",key:"location"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"},{in:"body",key:"size"}]}]);return(t?.client??this.client).post({url:"/api/pty",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}remove(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/pty/{ptyID}",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/pty/{ptyID}",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"},{in:"body",key:"title"},{in:"body",key:"size"}]}]);return(t?.client??this.client).put({url:"/api/pty/{ptyID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connectToken(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).post({url:"/api/pty/{ptyID}/connect-token",...t,...n})}connect(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location[directory]"},{in:"query",key:"location[workspace]"},{in:"query",key:"cursor"},{in:"query",key:"ticket"},{in:"query",key:"replayExited"}]}]);return(t?.client??this.client).get({url:"/api/pty/{ptyID}/connect",...t,...n})}}class Dk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/question/request",...t,...n})}}class kk extends AA{_request;get request(){return this._request??=new Dk({client:this.client})}}class bk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/reference",...t,...n})}}class vk extends AA{remove(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"},{in:"body",key:"directory"},{in:"body",key:"force"}]}]);return(t?.client??this.client).delete({url:"/experimental/project/{projectID}/copy",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}create(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"},{in:"body",key:"strategy"},{in:"body",key:"directory"},{in:"body",key:"name"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}refresh(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy/refresh",...t,...n})}}class Mk extends AA{_health;get health(){return this._health??=new ik({client:this.client})}_location;get location(){return this._location??=new rk({client:this.client})}_agent;get agent(){return this._agent??=new ok({client:this.client})}_session;get session(){return this._session??=new gk({client:this.client})}_model;get model(){return this._model??=new ck({client:this.client})}_provider;get provider(){return this._provider??=new dk({client:this.client})}_integration;get integration(){return this._integration??=new Ek({client:this.client})}_credential;get credential(){return this._credential??=new Ck({client:this.client})}_permission;get permission(){return this._permission??=new Ik({client:this.client})}_fs;get fs(){return this._fs??=new fk({client:this.client})}_command;get command(){return this._command??=new pk({client:this.client})}_skill;get skill(){return this._skill??=new mk({client:this.client})}_event;get event(){return this._event??=new wk({client:this.client})}_pty;get pty(){return this._pty??=new yk({client:this.client})}_question;get question(){return this._question??=new kk({client:this.client})}_reference;get reference(){return this._reference??=new bk({client:this.client})}_projectCopy;get projectCopy(){return this._projectCopy??=new vk({client:this.client})}}class Wc extends AA{static __registry=new J2;constructor(e){super(e),Wc.__registry.set(this,e?.key)}_auth;get auth(){return this._auth??=new H2({client:this.client})}_app;get app(){return this._app??=new Y2({client:this.client})}_experimental;get experimental(){return this._experimental??=new AD({client:this.client})}_global;get global(){return this._global??=new tD({client:this.client})}_event;get event(){return this._event??=new nD({client:this.client})}_config;get config(){return this._config??=new iD({client:this.client})}_tool;get tool(){return this._tool??=new rD({client:this.client})}_worktree;get worktree(){return this._worktree??=new oD({client:this.client})}_find;get find(){return this._find??=new sD({client:this.client})}_file;get file(){return this._file??=new aD({client:this.client})}_instance;get instance(){return this._instance??=new lD({client:this.client})}_path;get path(){return this._path??=new gD({client:this.client})}_vcs;get vcs(){return this._vcs??=new dD({client:this.client})}_command;get command(){return this._command??=new QD({client:this.client})}_lsp;get lsp(){return this._lsp??=new BD({client:this.client})}_formatter;get formatter(){return this._formatter??=new ED({client:this.client})}_mcp;get mcp(){return this._mcp??=new uD({client:this.client})}_project;get project(){return this._project??=new hD({client:this.client})}_pty;get pty(){return this._pty??=new ID({client:this.client})}_question;get question(){return this._question??=new fD({client:this.client})}_permission;get permission(){return this._permission??=new pD({client:this.client})}_provider;get provider(){return this._provider??=new wD({client:this.client})}_session;get session(){return this._session??=new yD({client:this.client})}_part;get part(){return this._part??=new DD({client:this.client})}_sync;get sync(){return this._sync??=new bD({client:this.client})}_tui;get tui(){return this._tui??=new SD({client:this.client})}_agentBuilder;get agentBuilder(){return this._agentBuilder??=new xD({client:this.client})}_backgroundProcess;get backgroundProcess(){return this._backgroundProcess??=new LD({client:this.client})}_branchName;get branchName(){return this._branchName??=new _D({client:this.client})}_commitMessage;get commitMessage(){return this._commitMessage??=new FD({client:this.client})}_enhancePrompt;get enhancePrompt(){return this._enhancePrompt??=new GD({client:this.client})}_indexing;get indexing(){return this._indexing??=new RD({client:this.client})}_interactiveTerminal;get interactiveTerminal(){return this._interactiveTerminal??=new UD({client:this.client})}_kilo;get kilo(){return this._kilo??=new YD({client:this.client})}_kilocode;get kilocode(){return this._kilocode??=new $D({client:this.client})}_anacondaDesktop;get anacondaDesktop(){return this._anacondaDesktop??=new WD({client:this.client})}_network;get network(){return this._network??=new ZD({client:this.client})}_remote;get remote(){return this._remote??=new XD({client:this.client})}_sandbox;get sandbox(){return this._sandbox??=new Ak({client:this.client})}_suggestion;get suggestion(){return this._suggestion??=new ek({client:this.client})}_telemetry;get telemetry(){return this._telemetry??=new tk({client:this.client})}_memory;get memory(){return this._memory??=new nk({client:this.client})}_v2;get v2(){return this._v2??=new Mk({client:this.client})}}function Nk(A,e,t,n){if(!n?.throwOnError||A instanceof Error)return A;if(typeof A=="object"&&A!==null&&Object.keys(A).length>0){const r=A,o=typeof r.data?.message=="string"&&r.data.message||typeof r.message=="string"&&r.message||typeof r.name=="string"&&r.name||zd(t,e);return new Error(o,{cause:{body:A,status:e?.status}})}if(typeof A=="string"&&A.length>0)return new Error(A,{cause:{body:A,status:e?.status}});const i=e?"(empty response body)":"network error (no response)";return new Error(`kilo server ${zd(t,e)}: ${i}`,{cause:{body:A,status:e?.status}})}function zd(A,e){const t=A?.method??"?",n=A?.url??"?",i=e?.status,r=e?.statusText;return`${t} ${n}${i?" → "+i:""}${r?" "+r:""}`}function Sk(A,e,t){if(A)return e&&(A===e||t&&A===t(e))?e:A}function xk(A,e){if(A.method!=="GET"&&A.method!=="HEAD")return A;const t=new URL(A.url);let n=!1;for(const[r,o]of[["x-kilo-directory","directory"],["x-kilo-workspace","workspace"]]){const s=Sk(A.headers.get(r),o==="directory"?e.directory:e.workspace,o==="directory"?encodeURIComponent:void 0);if(s){for(const a of t.pathname.startsWith("/api/")?[o,`location[${o}]`]:[o])t.searchParams.has(a)||t.searchParams.set(a,s);n=!0}}if(!n)return A;const i=new Request(t,A);return i.headers.delete("x-kilo-directory"),i.headers.delete("x-kilo-workspace"),i}function Lk(A){A?.fetch||(A={...A,fetch:n=>fetch(n,{duplex:"half",timeout:!1})}),A?.directory&&(A.headers={...A.headers,"x-kilo-directory":encodeURIComponent(A.directory)}),A?.experimental_workspaceID&&(A.headers={...A.headers,"x-kilo-workspace":A.experimental_workspaceID}),A.duplex="half";const e=ZC(A);return e.interceptors.request.use(t=>xk(t,{directory:A?.directory,workspace:A?.experimental_workspaceID})),e.interceptors.response.use(t=>{if(t.headers.get("content-type")==="text/html")throw new Error("Request is not supported by this version of OpenCode Server (Server responded with text/html)");return t}),e.interceptors.error.use(Nk),new Wc({client:e})}const _k=Array.from({length:20},(A,e)=>4097+e),Fk=1440*60*1e3,Zc="kilo.config.server",Pi={},Xc=window.fetch.bind(window);function Gk(A){const e=new TextEncoder().encode(A);return btoa(String.fromCharCode(...e))}function $d(A){return A?decodeURIComponent(A):""}function pa(A){const e=new URL(A),t=$d(e.username)||"kilo",n=$d(e.password)||"kilo";return e.username="",e.password="",e.search="",e.hash="",{url:e.toString().replace(/\/$/,""),token:Gk(`${t}:${n}`)}}function JA(A){const e=pa(A.url);return Lk({baseUrl:e.url,directory:ma(A.dir),headers:{Authorization:`Basic ${e.token}`},fetch:Xc})}function ma(A){const e=A.trim();if(e)return e}function Ss(A){return A instanceof Error?A.message:typeof A=="string"?A:A==null?"Unknown error":JSON.stringify(A)}function xA(A,e){if(e.error)throw new Error(`${A}: ${Ss(e.error)}`);if(e.data===void 0)throw new Error(`${A}: empty response`);return e.data}async function Rk(A){const t=(await ya(A)).find(n=>n.id===A.project);if(!t)throw new Error(`Project not found: ${A.project}`);return t}async function $1(A,e){return await e.then(t=>{if(t.error){console.warn(`${A}: ${Ss(t.error)}`);return}return t.data}).catch(t=>{console.warn(`${A}: ${Ss(t)}`)})}function Uk(A){if(typeof A!="string")return;const e=A.indexOf("/");if(!(e<=0||e>=A.length-1))return{provider:A.slice(0,e),model:A.slice(e+1)}}function wa(A){const e=ma(A.dir);return e?{directory:e}:void 0}function Tk(A){return A.split("_").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ok(A){return{keybinds:Object.entries(A.keybinds??{}).map(([e,t])=>({id:e,label:Tk(e),group:"Configured",default:t??"none",description:"Configured TUI keybind"}))}}function xs(A){return A.replace(/\\/g,"/").replace(/\/+$/,"")||"/"}function Kk(A,e){const t=xs(A),n=xs(e);return n===t?!0:n.startsWith(`${t}/`)}function Au(A){return A.id!=="global"?!0:xs(A.worktree)!=="/"}function qk(A,e){return[A.worktree,...A.sandboxes].reduce((t,n)=>Kk(n,e)?Math.max(t,xs(n).length):t,-1)}function Jk(A,e){const t=A.find(n=>n.id===e.projectID);return t||A.reduce((n,i)=>{const r=qk(i,e.directory);return r<=n.score?n:{item:i,score:r}},{score:-1}).item}async function eu(A){const e=new AbortController,t=window.setTimeout(()=>e.abort(),400),n=pa(A);return await Xc(`${n.url}/global/health`,{headers:{Authorization:`Basic ${n.token}`},signal:e.signal}).then(i=>i.ok?A:void 0).catch(()=>{}).finally(()=>window.clearTimeout(t))}function Hk(A){return Array.isArray(A)?A.filter(e=>{if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.worktree=="string"&&typeof t.time?.updated=="number"}):[]}function Yk(A){return A.reduce((e,t)=>Math.max(e,t.time.updated),0)}async function Pk(A){if(!await eu(A))return;const t=new AbortController,n=window.setTimeout(()=>t.abort(),400),i=pa(A);return await Xc(`${i.url}/project`,{headers:{Authorization:`Basic ${i.token}`},signal:t.signal}).then(async r=>{if(!r.ok)return{url:A,count:0,time:0};const o=Hk(await r.json()).filter(Au);return{url:A,count:o.length,time:Yk(o)}}).catch(()=>({url:A,count:0,time:0})).finally(()=>window.clearTimeout(n))}function Wd(A){return Number(new URL(A).port)||0}function Zd(A){return new URL(A).hostname==="127.0.0.1"?1:0}function C1(){return window.localStorage.getItem(Zc)??""}function Fe(A){window.localStorage.setItem(Zc,A)}function qn(){window.localStorage.removeItem(Zc)}async function Vk(A){return await eu(A)!==void 0}async function jk(){const A=_k.flatMap(t=>[`http://127.0.0.1:${t}`,`http://localhost:${t}`]);return(await Promise.all(A.map(Pk))).filter(t=>t!==void 0).toSorted((t,n)=>n.count-t.count||n.time-t.time||Wd(n.url)-Wd(t.url)||Zd(n.url)-Zd(t.url))[0]?.url}async function Jn(){if(Pi.run)return await Pi.run;const A=jk().finally(()=>{Pi.run===A&&(Pi.run=void 0)});return Pi.run=A,await A}async function Mi(){const A=await Jn();if(A)return A;const e=C1();if(e){if(await Vk(e))return e;qn()}}async function zk(A){const e=JA(A),[t,n,i,r,o,s,a,l,c,g,d,Q]=await Promise.all([e.global.health(),e.config.overlay({scope:A.scope}),e.config.modelState(),e.provider.list(),e.provider.auth(),e.tui.config.get(),$1("TUI keybinds",e.tui.keybind.list()),e.tool.ids(),e.mcp.status(),e.lsp.status(),e.formatter.status(),e.app.agents()]),B=xA("Config overlay",n),C=Uk(B.effective.model),I=C?await $1("Tool metadata",e.tool.list(C)):void 0,f=xA("TUI config",s);return{health:xA("Health",t),effective:B.effective,overlay:B,sources:{sources:B.sources},modelState:xA("Model state",i),providers:xA("Providers",r),authMethods:xA("Provider auth methods",o),tui:f,keybinds:a??Ok(f),tools:xA("Tools",l),toolDetails:I??[],mcp:xA("MCP status",c),lsp:xA("LSP status",g),formatter:xA("Formatter status",d),agents:xA("Agents",Q)}}async function $k(A){return xA("Kilo embedding models",await JA(A).indexing.models())}async function tu(A){const t=await JA(A).kilo.profile(wa(A));return xA("Kilo profile",t)}async function Wk(A,e){const t=JA(A),n=await t.kilo.organization.set({...wa(A),organizationId:e});xA("Switch Kilo account",n),await t.global.dispose()}async function Zk(A){const e=JA(A),t=await e.auth.remove({providerID:"kilo"});xA("Log out of Kilo",t),await e.global.dispose()}async function Xk(A){const t=await JA(A).provider.oauth.authorize({...wa(A),providerID:"kilo",method:0});return xA("Start Kilo login",t)}async function A3(A,e){const t=JA(A),n=await t.provider.oauth.callback({...wa(A),providerID:"kilo",method:0},e?{signal:e}:void 0);xA("Complete Kilo login",n),await t.global.dispose()}async function nu(A){const e=JA(A),t=ma(A.dir),n=await e.project.list(t?{directory:t}:void 0);return xA("Projects",n)}async function ya(A){return(await nu(A)).filter(Au)}async function e3(A){const e=JA(A),[t,n]=await Promise.all([ya(A),e.experimental.session.list({archived:!1,start:Date.now()-Fk,limit:500})]),i=xA("Recent sessions",n),r=new Map;for(const o of i){const s=Jk(t,o);s&&r.set(s.id,(r.get(s.id)??0)+1)}return t.map(o=>({...o,sessions:r.get(o.id)??0})).filter(o=>o.sessions>0)}async function t3(A){const e=await Rk(A),t={url:A.url,dir:e.worktree},n=JA(t),[i,r,o]=await Promise.all([n.config.overlay({scope:"global"}),n.vcs.get({directory:t.dir}),n.worktree.list({directory:t.dir})]),s=xA("Config",i),a=xA("Worktrees",o),l=await Promise.all([t.dir,...a.map(c=>c.directory)].map(c=>o3({url:A.url},c)));return{project:e,config:s.global,vcs:xA("VCS",r),worktrees:a,terminals:l.flat()}}async function n3(A,e){const t=JA(A),n=e?.trim(),i=await t.worktree.create({directory:A.dir,...n?{worktreeCreateInput:{name:n}}:{}});return xA("Create worktree",i)}async function i3(A,e){const n=await JA(A).worktree.remove({directory:A.dir,worktreeRemoveInput:{directory:e}});return xA("Remove worktree",n)}async function r3(A,e){const n=await JA(A).worktree.reset({directory:A.dir,worktreeResetInput:{directory:e}});return xA("Reset worktree",n)}async function o3(A,e){const t=JA({url:A.url,dir:e}),[n,i,r,o]=await Promise.all([t.pty.list({directory:e}),$1("Session status",t.session.status({directory:e})),$1("Pending permissions",t.permission.list({directory:e})),$1("Pending questions",t.question.list({directory:e}))]),s=xA("Terminals",n),a=i??{},l=Xd(r??[]),c=Xd(o??[]),g=new Map;return await Promise.all(s.map(async d=>{if(!d.sessionID||g.has(d.sessionID))return;const Q=await $1("Session",t.session.get({directory:e,sessionID:d.sessionID}));Q&&g.set(d.sessionID,Q)})),s.map(d=>{const Q=d.sessionID?g.get(d.sessionID):void 0;return{...d,directory:e,session:Q,sessionStatus:d.sessionID?a[d.sessionID]:void 0,attention:d.sessionID?l3(d.sessionID,l,c):void 0}})}function iu(A){return new Set(A.flatMap(e=>e.sessionID?[e.sessionID]:[]))}function Xd(A){return new Set(A.map(e=>e.sessionID))}function AQ(A,e){return A.some(t=>e.has(t.sessionID))}async function s3(A,e){const t=JA({url:A.url,dir:e}),[n,i,r,o]=await Promise.all([$1("Session status",t.session.status({directory:e})),$1("Terminals",t.pty.list({directory:e})),$1("Pending permissions",t.permission.list({directory:e})),$1("Pending questions",t.question.list({directory:e}))]),s=iu(i??[]),a=Object.entries(n??{}).some(([c,g])=>s.has(c)&&g.type!=="idle"),l=AQ(r??[],s)||AQ(o??[],s);return{busy:a,attention:l}}async function a3(A,e){const t=JA({url:A.url,dir:e}),n=await $1("Terminals",t.pty.list({directory:e}));return iu(n??[])}function l3(A,e,t){if(e.has(A))return"permission";if(t.has(A))return"question"}async function g3(A,e){const n=await JA({url:A.url,dir:e}).worktree.diffSummary({directory:e});return xA("Worktree diff",n)}async function c3(A,e,t){const i=await JA({url:A.url,dir:e}).worktree.diffFile({directory:e,file:t});return xA("Worktree diff file",i)}async function d3(A,e,t="Kilo session"){const i=await JA({url:A.url,dir:e}).pty.create({directory:e,command:"kilo",cwd:e,title:t});return xA("Create terminal",i)}async function Q3(A,e){const n=await JA({url:A.url,dir:A.dir}).pty.remove({directory:A.dir,ptyID:e});return xA("Remove terminal",n)}async function eQ(A,e,t,n){const r=await JA(A).session.viewed({directory:A.dir,viewer:e,attached:t,visible:n});return xA("Viewed sessions",r)}function ru(A,e){const t=JA(A),n=new AbortController;return(async()=>{const i=await t.global.event({signal:n.signal,sseMaxRetryAttempts:0});for await(const r of i.stream){if(n.signal.aborted)return;e(r)}})().catch(i=>{n.signal.aborted||console.warn(`Project events: ${Ss(i)}`)}),()=>n.abort()}async function B3(A,e,t,n){const r=await JA({url:A.url,dir:A.dir}).pty.update({directory:A.dir,ptyID:e,size:{cols:t,rows:n}});return xA("Resize terminal",r)}function E3(A,e,t=0){const n=pa(A.url),i=new URL(`/pty/${encodeURIComponent(e)}/connect`,n.url);return i.protocol=i.protocol==="https:"?"wss:":"ws:",i.searchParams.set("directory",A.dir),i.searchParams.set("cursor",String(t)),i.searchParams.set("auth_token",n.token),i.toString()}async function _r(A,e,t){const n=JA(A),i=Object.keys(e).length?e:void 0,r=await n.config.overlayUpdate({directory:ma(A.dir),scope:A.scope,set:i,unset:t});return xA("Update config",r)}async function C3(A,e){return _r(A,e)}async function u3(A,e){return _r(A,{},e)}async function h3(A,e){const n=await JA(A).config.modelStateUpdate({favorite:e});return xA("Update model state",n)}async function I3(A,e,t,n){const i=JA(A),r=n?{type:"api",key:t,metadata:n}:{type:"api",key:t},o=await i.auth.set({providerID:e,auth:r});xA("Connect provider",o),await i.global.dispose()}async function f3(A,e,t,n){const r=await JA(A).provider.oauth.authorize({providerID:e,method:t,inputs:n});return xA("Authorize provider",r)}async function p3(A,e,t,n){const i=JA(A),r=await i.provider.oauth.callback({providerID:e,method:t,code:n});xA("Complete provider authorization",r),await i.global.dispose()}async function m3(A,e){const n=await JA(A).mcp.connect({name:e});return xA("Connect MCP server",n)}async function w3(A,e){const n=await JA(A).mcp.disconnect({name:e});return xA("Disconnect MCP server",n)}async function y3(A,e){const n=await JA(A).mcp.auth.authenticate({name:e});return xA("Authenticate MCP server",n)}async function D3(A,e){const n=await JA(A).tui.config.update({scope:A.scope,...e});return xA("Update TUI config",n)}async function k3(A,e){const n=await JA(A).agentBuilder.preview(e);return xA("Preview agent",n)}async function b3(A,e){const n=await JA(A).agentBuilder.save({path_id:e.id,scope:e.scope,description:e.description,mode:e.mode,model:e.model,color:e.color,steps:e.steps,tools:e.tools,permission:e.permission,prompt:e.prompt});return xA("Save agent",n)}function v3(A){return!A||A==="normal"?"default":A==="small"?"sm":A==="large"?"lg":A}function M3(A){return!A||A==="default"?"primary":A}function eA(A){const[e,t]=MA(A,["variant","size","icon","class","classList","children"]);return E(Ia,fA(t,{"data-component":"button",get"data-size"(){return v3(e.size)},get"data-variant"(){return M3(e.variant)},get"data-icon"(){return e.icon?"inline-start":void 0},get classList(){return{...e.classList,[e.class??""]:!!e.class}},get children(){return[E(H,{get when(){return e.icon},children:n=>E(Q1,{get name(){return n()},size:"small"})}),IA(()=>e.children)]}}))}function N3(A,e){const t=Object.fromEntries(Object.entries(e).filter(n=>n[1]!==void 0));if(typeof A=="string"){const n=Object.entries(t).map(i=>`${i[0]}:${i[1]}`).join(";");return n?`${A};${n}`:A}return{...A??{},...t}}var S3=k("<div>");function RA(A){const[e,t]=MA(A,["variant","size","padding","style","class","classList","children"]),n=()=>typeof e.padding=="number"?`${e.padding}px`:e.padding;return(()=>{var i=S3();return e1(i,fA(t,{"data-component":"card",get"data-variant"(){return e.variant??"normal"},get"data-size"(){return e.size??"default"},get style(){return N3(e.style,{"--kw-card-padding":n()})},get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),h(i,()=>e.children),i})()}var x3=k("<span>");function ou(A){const[e,t]=MA(A,["size","tone","class","classList","children"]);return(()=>{var n=x3();return e1(n,fA(t,{"data-component":"tag",get"data-size"(){return e.size??"normal"},get"data-tone"(){return e.tone??"neutral"},get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),h(n,()=>e.children),n})()}var L3=k("<span data-slot=status-dot aria-hidden=true>"),_3=k("<p>"),F3=k("<section data-component=section-title><div><h2>"),G3=k("<div data-component=banner role=alert><div><span>"),R3=k("<strong>"),U3=k("<span data-slot=config-row-accent>"),T3=k("<div data-slot=config-row-body><div data-slot=config-row-title>"),O3=k("<div data-slot=config-row-trailing>"),K3=k("<div data-slot=config-row-leading>"),q3=k("<div data-slot=config-row-subtitle>"),J3=k("<div data-slot=config-row-actions>"),H3=k("<a data-component=config-row>"),Y3=k("<button type=button data-component=config-row>"),P3=k("<div data-component=config-row>");function qA(A){return E(ou,fA(A,{"data-slot":"config-tag"}))}function Ee(A){return E(qA,fA(A,{tone:"neutral"}))}function su(A){return A.source==="project"||A.source==="local override"?"project":A.source==="global"||A.source==="inherited"?"global":A.overridden?"project":A.inherited?"global":"default"}function au(A){return(()=>{var e=L3();return Y(()=>V(e,"data-tone",A.tone)),e})()}function Fr(A){const e=()=>["connected","healthy","running"].includes(A.status)?{tone:"success",label:A.status==="healthy"?"Healthy":A.status==="running"?"Running":"Connected"}:["failed","error","unhealthy"].includes(A.status)?{tone:"critical",label:A.status==="unhealthy"?"Unhealthy":A.status==="failed"?"Failed":"Error"}:A.status==="stopped"?{tone:"neutral",label:"Stopped"}:{tone:"neutral",label:A.status||"Unknown"};return E(qA,{get tone(){return e().tone},class:"kw-status-tag",get children(){return[E(au,{get tone(){return IA(()=>e().tone==="critical")()?"critical":e().tone==="success"?"success":"neutral"}}),IA(()=>e().label)]}})}function lu(A){const e=()=>su(A),t=()=>e().toUpperCase();return E(qA,{class:"mono",get tone(){return e()==="project"?"info":"neutral"},get children(){return t()}})}function tt(A){return(()=>{var e=F3(),t=e.firstChild,n=t.firstChild;return h(n,()=>A.children),h(t,()=>A.trailing,null),h(e,E(H,{get when(){return A.description},children:i=>(()=>{var r=_3();return h(r,i),r})()}),null),e})()}function V3(A){const e=()=>A.tone==="critical"||A.tone==="warning"?"warning":A.tone==="success"?"circle-check":"help";return(()=>{var t=G3(),n=t.firstChild,i=n.firstChild;return h(t,E(Q1,{get name(){return e()},size:"small"}),n),h(n,E(H,{get when(){return A.title},children:r=>(()=>{var o=R3();return h(o,r),o})()}),i),h(i,()=>A.children),h(t,()=>A.action,null),Y(()=>V(t,"data-tone",A.tone??"info")),t})()}function d1(A){const e=()=>su({source:A.source})==="project"||A.highlightOverride,t=()=>[E(H,{get when(){return e()},get children(){return U3()}}),E(H,{get when(){return A.leading},children:n=>(()=>{var i=K3();return h(i,n),i})()}),(()=>{var n=T3(),i=n.firstChild;return h(i,()=>A.title),h(n,E(H,{get when(){return A.subtitle},children:r=>(()=>{var o=q3();return h(o,r),o})()}),null),n})(),(()=>{var n=O3();return h(n,E(H,{get when(){return A.source!==void 0},get children(){return E(lu,{get source(){return A.source}})}}),null),h(n,()=>A.status,null),h(n,E(H,{get when(){return A.actions},children:i=>(()=>{var r=J3();return h(r,i),r})()}),null),n})()];return A.href?(()=>{var n=H3();return h(n,t),Y(i=>{var r=e()||void 0,o=A.href;return r!==i.e&&V(n,"data-override",i.e=r),o!==i.t&&V(n,"href",i.t=o),i},{e:void 0,t:void 0}),n})():A.onClick?(()=>{var n=Y3();return zA(n,"click",A.onClick,!0),h(n,t),Y(()=>V(n,"data-override",e()||void 0)),n})():(()=>{var n=P3();return h(n,t),Y(()=>V(n,"data-override",e()||void 0)),n})()}ie(["click"]);var j3=k("<details><summary></summary><div class=models-select-menu role=listbox>"),z3=k("<button class=models-select-option type=button role=option>");function M1(A){const e=()=>A.options.find(i=>i.value===A.value)?.label??A.value;function t(i,r){A.disabled||i.disabled||(A.onSelect(i.value),r.currentTarget.closest("details")?.removeAttribute("open"))}function n(i){if(A.disabled){i.currentTarget.removeAttribute("open");return}i.currentTarget.open&&i.currentTarget.parentElement?.querySelectorAll(".models-select[open]").forEach(r=>{r!==i.currentTarget&&r.removeAttribute("open")})}return(()=>{var i=j3(),r=i.firstChild,o=r.nextSibling;return i.addEventListener("toggle",n),h(r,e),h(o,E(hA,{get each(){return A.options},children:s=>(()=>{var a=z3();return a.$$click=l=>t(s,l),h(a,()=>s.label),Y(l=>{var c=s.value===A.value,g=!!s.disabled,d=s.value===A.value,Q=A.disabled||s.disabled;return c!==l.e&&a.classList.toggle("selected",l.e=c),g!==l.t&&a.classList.toggle("disabled",l.t=g),d!==l.a&&V(a,"aria-selected",l.a=d),Q!==l.o&&(a.disabled=l.o=Q),l},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()})),Y(s=>{var a=`models-select ${A.class??""}`,l=!!A.disabled,c=!!A.invalid,g=A.label,d=A.disabled,Q=A.label;return a!==s.e&&xn(i,s.e=a),l!==s.t&&i.classList.toggle("disabled",s.t=l),c!==s.a&&i.classList.toggle("invalid",s.a=c),g!==s.o&&V(r,"aria-label",s.o=g),d!==s.i&&V(r,"aria-disabled",s.i=d),Q!==s.n&&V(o,"aria-label",s.n=Q),s},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()}ie(["click"]);var $3=k("<label data-component=search-field><span data-slot=search-label></span><input>");function L1(A){const[e,t]=MA(A,["label","value","variant","hideLabel","inputClass","class","classList","onValue"]);return(()=>{var n=$3(),i=n.firstChild,r=i.nextSibling;return h(i,()=>e.label),e1(r,fA(t,{get class(){return e.inputClass},type:"search",get value(){return e.value},get"aria-label"(){return IA(()=>e.hideLabel===!1)()?void 0:e.label},onInput:o=>e.onValue(o.currentTarget.value)}),!1,!1),Y(o=>{var s=e.variant??"list",a=e.hideLabel===!1?"visible":"hidden",l={...e.classList,[e.class??""]:!!e.class};return s!==o.e&&V(n,"data-variant",o.e=s),a!==o.t&&V(n,"data-label",o.t=a),o.a=vi(n,l,o.a),o},{e:void 0,t:void 0,a:void 0}),n})()}const gu=A1();function xe(){const A=Pe(gu);if(!A)throw new Error("useConfig must be used within ConfigLayout");return A}function A0(){return"/console/".replace(/\/$/,"")}function lo(A,e=A0()){return!e||e==="/"?A:A===e?"/":A.startsWith(`${e}/`)?A.slice(e.length):A}function cu(A,e=A0()){const t=lo(A,e),n=t.indexOf("/settings");return n>0?`${t.slice(0,n)}/settings`:t.startsWith("/config")?"/config":"/settings"}function W3(A,e=A0()){const t=lo(A,e);return t==="/profile"||t.startsWith("/kilo/login")?"/profile":t.startsWith("/settings")||t.startsWith("/config")?"/settings":t.startsWith("/projects/")?"/project":"/projects"}const Z3={apply_patch:"Apply Patch",bash:"Bash",edit:"Edit File",glob:"Find Files",grep:"Search Content",lsp:"Language Server",question:"Ask User",read:"Read File",recall:"Local Recall",skill:"Load Skill",task:"Subagent Task",todowrite:"Todo List",webfetch:"Fetch URL",websearch:"Web Search",write:"Write File"},X3={apply_patch:["Apply structured patches to add, update, move, or delete files.","Keeps edits explicit and easy to review."],bash:["Run shell commands in the current workspace.","Supports timeouts, working directories, and command descriptions."],edit:["Replace exact text inside an existing file.","Can update one match or all matches when needed."],glob:["Find files by path patterns.","Useful for locating files before reading or editing them."],grep:["Search file contents with regular expressions.","Can limit results to a file pattern such as TypeScript or CSS files."],lsp:["Use language-server features for code navigation.","Supports operations such as definitions, references, and diagnostics."],question:["Ask the user for a decision during execution.","Supports single-choice and multi-choice prompts."],read:["Read files, directories, images, and PDFs from the workspace.","Supports line offsets and limits for large files."],recall:["Search and read previous project conversations.","Useful for recovering prior decisions or implementation context."],skill:["Load task-specific instructions and workflows.","Applies specialized repo guidance when a matching skill exists."],task:["Delegate focused exploration or implementation work to a subagent.","Useful for parallel codebase research and complex subtasks."],todowrite:["Track multi-step implementation work.","Shows progress with pending, in-progress, and completed states."],webfetch:["Fetch and convert web pages for analysis.","Supports markdown, text, and HTML output formats."],websearch:["Search the web for external information.","Supports fast, automatic, and deep search modes."],write:["Create or overwrite files with complete contents.","Best for new files or full-file replacements."]},A8=new Set(["api","html","id","json","lsp","mcp","pdf","url"]);function LA(A){return A.trim()}function wn(A){return A==null||A===""?"Not set":typeof A=="string"?A:typeof A=="number"||typeof A=="boolean"?String(A):JSON.stringify(A)??"Unserializable value"}function du(A){return[...A].sort((e,t)=>e.localeCompare(t))}function Rg(A){return A.split(/\s+/).map(e=>e.trim()).filter(Boolean)}function E1(A){return A.trim().split(/[\s._/-]+/).filter(Boolean).map(e=>/^[A-Z0-9]+$/.test(e)&&e.length<=4?e:`${e[0]?.toUpperCase()??""}${e.slice(1).toLowerCase()}`).join(" ")}function e8(A){const e=A.toLowerCase();return A8.has(e)?e.toUpperCase():A.charAt(0).toUpperCase()+A.slice(1)}function tQ(A){return A.length<=180?A:`${A.slice(0,177)}...`}function t8(A){const e=A.replace(/```[\s\S]*?```/g," ").replace(/[*`#>_-]+/g," ").replace(/\s+/g," ").trim(),t=e.split(/(?:\.|\?|!)\s+/).map(n=>n.trim()).filter(Boolean).slice(0,2);return t.length?t.map(tQ):e?[tQ(e)]:[]}function Et(A){const e=Z3[A];if(e)return e;const t=A.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[._:/-]+/g," ").replace(/\s+/g," ").trim();return t?t.split(" ").map(e8).join(" "):A}function e0(A){const e=X3[A.id];if(e)return e;const t=A.detail?.description.trim();return t?t8(t):["No capability description is available for this tool."]}function hi(A){return A.split(",").map(e=>e.trim()).filter(Boolean)}function nQ(A){return!A||typeof A!="object"||Array.isArray(A)?0:Object.keys(A).length}function Qe(A){return A instanceof Error?A.message:typeof A=="string"?A:wn(A)}function n8(A){return A==="subagent"?"subagent":A==="all"?"all":"primary"}var i8=k("<main class=config-page><section class=config-page-header><div><h1>"),r8=k("<p>"),o8=k("<div class=config-page-actions>"),s8=k("<section class=config-toolbar>"),a8=k("<div class=config-toolbar-controls>"),l8=k("<div class=config-toolbar-meta>");function Le(A){return(()=>{var e=i8(),t=e.firstChild,n=t.firstChild,i=n.firstChild;return h(i,()=>A.title),h(n,E(H,{get when(){return A.description},children:r=>(()=>{var o=r8();return h(o,r),o})()}),null),h(t,E(H,{get when(){return A.actions},children:r=>(()=>{var o=o8();return h(o,r),o})()}),null),h(e,()=>A.children,null),e})()}function Qu(A){return E(H,{get when(){return A.children||A.meta},get children(){var e=s8();return h(e,E(H,{get when(){return A.children},children:t=>(()=>{var n=a8();return h(n,t),n})()}),null),h(e,E(H,{get when(){return A.meta},children:t=>(()=>{var n=l8();return h(n,t),n})()}),null),e}})}function de(A){return E(lu,A)}const Bu=[{value:"ask",label:"Ask"},{value:"allow",label:"Allow"},{value:"deny",label:"Deny"}],Tt=[{id:"external_directory",title:"External Directory",description:"Access files outside the project directory.",noun:"path",placeholder:"e.g. ~/Downloads/**"},{id:"bash",title:"Bash",description:"Run shell commands.",noun:"command",placeholder:"e.g. git status or npm *"},{id:"read",title:"Read",description:"Read files by matching file paths.",noun:"path",placeholder:"e.g. **/*.env"},{id:"edit",title:"Edit",description:"Modify files, including writes, patches, and multi-edits.",noun:"path",placeholder:"e.g. src/**/*.ts"}],t0=[{id:"glob",title:"Glob",description:"Match files using glob patterns."},{id:"grep",title:"Grep",description:"Search file contents using regular expressions."},{id:"list",title:"List",description:"List files within a directory."},{id:"task",title:"Task",description:"Launch sub-agents."},{id:"skill",title:"Skill",description:"Load a skill by name."},{id:"lsp",title:"LSP",description:"Run language server queries."},{id:"todowrite",title:"Todo Write",description:"Update the todo list."},{id:"question",title:"Question",description:"Ask the user a question."},{id:"webfetch",title:"Web Fetch",description:"Fetch content from a URL."},{id:"websearch",title:"Web Search",description:"Search the web."},{id:"doom_loop",title:"Doom Loop",description:"Detect repeated tool calls with identical input."},{id:"agent_manager",title:"Agent Manager",description:"Manage Agent Manager operations."}],Eu=[...Tt,...t0],g8=new Set(Tt.map(A=>A.id)),c8=new Set(Eu.map(A=>A.id));function n0(A,e="ask"){return A==="ask"||A==="allow"||A==="deny"?A:e}function Da(A){return A&&typeof A=="object"&&!Array.isArray(A)?A:{}}function Cu(A){return Da(A.effective.permission)}function i0(A,e){return A.overlay.collections.permission?.find(t=>t.key===e)}function uu(A,e){return typeof A.effective.permission=="string"?A.effective.permission:Cu(A)[e]}function hu(A){return n0(A.effective.permission)}function d8(A,e){return A?e==="*"&&typeof A.value=="string"?A.path:[...A.path,e]:["permission",e]}function Gr(A,e,t,n){if(!(t!=="ask"&&t!=="allow"&&t!=="deny"))return{tool:A,pattern:e,action:t,source:n?.source??"default",inherited:n?.inherited??!1,overridden:n?.overridden??!1,path:n?d8(n,e):["permission",A,e]}}function Q8(A){const e=A.value;if(e&&typeof e=="object"&&!Array.isArray(e))return Object.entries(e).flatMap(([n,i])=>Gr(A.key,n,i,A)??[]);const t=Gr(A.key,"*",e,A);return t?[t]:[]}function B8(A,e,t){const n=Da(e);if(Object.keys(n).length)return Object.entries(n).flatMap(([r,o])=>Gr(A,r,o,t)??[]);const i=Gr(A,"*",e,t);return i?[i]:[]}function E8(A,e){const t=i0(A,e.id),n=uu(A,e.id),i=Da(n),r=hu(A);return{...e,action:n0(typeof n=="string"?n:i["*"],r),source:t?.source??"default",inherited:t?.inherited??!1,overridden:t?.overridden??!1}}function C8(A,e){const t=i0(A,e.id),n=uu(A,e.id),i=Da(n),r=hu(A);return{...e,action:n0(typeof n=="string"?n:i["*"],r),source:t?.source??"default",inherited:t?.inherited??!1,overridden:t?.overridden??!1,rules:Object.entries(i).filter(([o])=>o!=="*").flatMap(([o,s])=>Gr(e.id,o,s,t)??[])}}function u8(){const A=xe(),e=()=>A.data(),[t,n]=T("closed"),[i,r]=T("external_directory"),[o,s]=T(""),[a,l]=T("ask"),c=R(()=>(e()?.overlay.collections.permission??[]).flatMap(Q8)),g=R(()=>{const w=e();return w?Tt.map(m=>C8(w,m)):[]}),d=R(()=>{const w=e();return w?t0.map(m=>E8(w,m)):[]}),Q=R(()=>{const w=e();return w?Object.entries(Cu(w)).filter(([m])=>!c8.has(m)).flatMap(([m,y])=>B8(m,y,i0(w,m))).sort((m,y)=>m.tool.localeCompare(y.tool)||m.pattern.localeCompare(y.pattern)):[]}),B=R(()=>Tt.find(w=>w.id===i())??Tt[0]);function C(w){r(w),s(""),l("ask"),n("rule")}function I(){n("closed")}function f(){const w=e(),m=LA(o());if(!w||!m){A.fail(`Enter a ${B().noun} pattern before saving.`);return}const y={[i()]:{[m]:a()}};A.save({permission:y}),I()}function u(w,m){const y=g8.has(w)?{[w]:{"*":m}}:{[w]:m};A.save({permission:y})}function p(w){A.unset([w.path])}return{ctx:A,mode:t,kind:i,pattern:o,setPattern:s,action:a,setAction:l,rules:c,groups:g,settings:d,other:Q,selected:B,open:C,close:I,add:f,setDefault:u,remove:p}}var Ug=k("<div class=permission-row-meta>"),h8=k('<details class="models-select permission-select"><summary></summary><div class=models-select-menu role=listbox>'),I8=k("<button class=models-select-option type=button role=option>"),f8=k("<section class=permission-group><div class=permission-rules>"),p8=k("<div class=permissions><section class=permission-group><div class=permission-rules>"),m8=k("<div class=drawer-scrim>"),w8=k('<aside class="provider-drawer permission-drawer"aria-label="Permission rule configuration"><header class=drawer-header><div><h2></h2><span></span></div></header><div class="provider-form permission-form"><label class="required-field wide"><input></label><label class="required-field wide">Method</label></div><footer class=drawer-footer>'),y8=k("<span class=config-title-count>Permissions"),D8=k("<section class=permission-group><header class=permission-group-header><div class=permission-group-copy><h2></h2><span></span><p></p></div><div class=permission-section-actions></div></header><div class=permission-rules>"),k8=k("<p class=permission-empty>No specific <!> rules."),b8=k("<span class=permission-pattern>"),v8=k("<span class=permission-subtitle><span></span><span class=permission-pattern>");function Iu(A){return A==="allow"?"success":A==="deny"?"critical":"warning"}function r0(A){return Bu.find(e=>e.value===A)?.label??A}function iQ(A){return(()=>{var e=Ug();return h(e,E(qA,{get tone(){return Iu(A.rule.action)},get children(){return r0(A.rule.action)}}),null),h(e,E(de,{get source(){return A.rule.source},get inherited(){return A.rule.inherited},get overridden(){return A.rule.overridden}}),null),e})()}function Ii(A){const e=()=>r0(A.value);function t(i,r){A.disabled||(A.onSelect(i),r.currentTarget.closest("details")?.removeAttribute("open"))}function n(i){if(A.disabled){i.currentTarget.removeAttribute("open");return}i.currentTarget.open&&i.currentTarget.parentElement?.querySelectorAll(".models-select[open]").forEach(r=>{r!==i.currentTarget&&r.removeAttribute("open")})}return(()=>{var i=h8(),r=i.firstChild,o=r.nextSibling;return i.addEventListener("toggle",n),h(r,e),h(o,E(hA,{each:Bu,children:s=>(()=>{var a=I8();return a.$$click=l=>t(s.value,l),h(a,()=>s.label),Y(l=>{var c=s.value===A.value,g=s.value===A.value;return c!==l.e&&a.classList.toggle("selected",l.e=c),g!==l.t&&V(a,"aria-selected",l.t=g),l},{e:void 0,t:void 0}),a})()})),Y(s=>{var a=!!A.disabled,l=A.label,c=A.disabled,g=A.label;return a!==s.e&&i.classList.toggle("disabled",s.e=a),l!==s.t&&V(r,"aria-label",s.t=l),c!==s.a&&V(r,"aria-disabled",s.a=c),g!==s.o&&V(o,"aria-label",s.o=g),s},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()}function M8(){const A=u8();return E(Le,{get title(){return(()=>{var e=y8();return e.firstChild,h(e,E(Ee,{get children(){return A.groups().length+A.settings().length}}),null),e})()},description:"Control what tools agents can use by default and add pattern-specific allow, ask, or deny rules.",get children(){return[(()=>{var e=p8(),t=e.firstChild,n=t.firstChild;return h(e,E(hA,{get each(){return A.groups()},children:i=>(()=>{var r=D8(),o=r.firstChild,s=o.firstChild,a=s.firstChild,l=a.nextSibling,c=l.nextSibling,g=s.nextSibling,d=o.nextSibling;return h(a,()=>i.title),h(l,()=>i.id),h(c,()=>i.description),h(g,E(Ee,{get children(){return i.rules.length}}),null),h(g,E(eA,{icon:"plus",variant:"primary",get disabled(){return!!A.ctx.saving()},onClick:()=>A.open(i.id),children:"Add rule"}),null),h(r,E(d1,{title:"Default method",get subtitle(){return`Used for ${i.noun}s that do not match a specific rule.`},get status(){return(()=>{var Q=Ug();return h(Q,E(de,{get source(){return i.source},get inherited(){return i.inherited},get overridden(){return i.overridden}})),Q})()},get actions(){return E(Ii,{get label(){return`Default method for ${i.title}`},get value(){return i.action},get disabled(){return!!A.ctx.saving()},onSelect:Q=>A.setDefault(i.id,Q)})}}),d),h(d,E(H,{get when(){return i.rules.length},get fallback(){return(()=>{var Q=k8(),B=Q.firstChild,C=B.nextSibling;return C.nextSibling,h(Q,()=>i.noun,C),Q})()},get children(){return E(hA,{get each(){return i.rules},children:Q=>E(d1,{get title(){return(()=>{var B=b8();return h(B,()=>Q.pattern),B})()},get subtitle(){return`${i.title} ${i.noun} rule`},get status(){return E(iQ,{rule:Q})},get actions(){return E(ke,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${i.title} rule ${Q.pattern}`},get disabled(){return!!A.ctx.saving()},onClick:()=>A.remove(Q)})}})})}})),r})()}),t),h(t,E(tt,{get trailing(){return E(Ee,{get children(){return A.settings().length}})},description:"Default methods for additional built-in tool permissions.",children:"Tool Defaults"}),n),h(n,E(hA,{get each(){return A.settings()},children:i=>E(d1,{get title(){return i.title},get subtitle(){return`${i.id} · ${i.description}`},get status(){return(()=>{var r=Ug();return h(r,E(de,{get source(){return i.source},get inherited(){return i.inherited},get overridden(){return i.overridden}})),r})()},get actions(){return E(Ii,{get label(){return`Default method for ${i.title}`},get value(){return i.action},get disabled(){return!!A.ctx.saving()},onSelect:r=>A.setDefault(i.id,r)})}})})),h(e,E(H,{get when(){return A.other().length},get children(){var i=f8(),r=i.firstChild;return h(i,E(tt,{get trailing(){return E(Ee,{get children(){return A.other().length}})},description:"Additional tool permission rules from config.",children:"Other Permissions"}),r),h(r,E(hA,{get each(){return A.other()},children:o=>E(d1,{get title(){return Et(o.tool)},get subtitle(){return(()=>{var s=v8(),a=s.firstChild,l=a.nextSibling;return h(a,()=>o.tool),h(l,()=>o.pattern),s})()},get status(){return E(iQ,{rule:o})},get actions(){return E(ke,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${o.tool} rule ${o.pattern}`},get disabled(){return!!A.ctx.saving()},onClick:()=>A.remove(o)})}})})),i}}),null),e})(),E(H,{get when(){return A.mode()==="rule"},get children(){return[(()=>{var e=m8();return zA(e,"click",A.close,!0),e})(),(()=>{var e=w8(),t=e.firstChild,n=t.firstChild,i=n.firstChild,r=i.nextSibling,o=t.nextSibling,s=o.firstChild,a=s.firstChild,l=s.nextSibling;l.firstChild;var c=o.nextSibling;return h(i,()=>`Add ${A.selected().title} Rule`),h(r,()=>`${A.selected().id} · ${A.selected().description}`),h(t,E(eA,{variant:"ghost","aria-label":"Close permission rule overlay",get onClick(){return A.close},children:"X"}),null),h(s,()=>A.selected().noun==="command"?"Command pattern":"Path pattern",a),a.$$input=g=>A.setPattern(g.currentTarget.value),V(a,"spellcheck",!1),h(l,E(Ii,{label:"Rule method",get value(){return A.action()},get disabled(){return!!A.ctx.saving()},get onSelect(){return A.setAction}}),null),h(c,E(eA,{variant:"ghost",get onClick(){return A.close},children:"Cancel"}),null),h(c,E(eA,{variant:"primary",get disabled(){return!!A.ctx.saving()},get onClick(){return A.add},children:"Save Rule"}),null),Y(()=>V(a,"placeholder",A.selected().placeholder)),Y(()=>a.value=A.pattern()),e})()]}})]}})}ie(["click","input"]);const N8=["Review the current diff and report risks, regressions, and missing tests.","Plan the work in small steps, then implement the smallest correct change.","Inspect relevant files first, then summarize the root cause before editing.","Run the smallest relevant validation checks and report any remaining failures."];function S8(A,e){return A.id==="kilo"?-1:e.id==="kilo"?1:A.name.localeCompare(e.name)}function x8(A,e){return A.provider.id===e.providerID&&A.model.id===e.modelID?!0:A.model.providerID===e.providerID&&A.model.id===e.modelID}function hl(A){const e=LA(A);if(e)return e}function L8(A){const e=Number(A);if(Number.isInteger(e)&&e>0)return e}function xt(A){return A&&typeof A=="object"&&!Array.isArray(A)?A:{}}function Xt(A){return typeof A=="string"?A:""}function _8(A){if(typeof A=="number"&&Number.isFinite(A))return A}function rQ(A,e="ask"){return A==="allow"||A==="deny"||A==="ask"?A:e}function Tg(A,e,t){if(!(t!=="allow"&&t!=="deny"&&t!=="ask"))return{tool:A,pattern:e,action:t}}function oQ(A,e){const t=xt(e);if(Object.keys(t).length)return Object.entries(t).flatMap(([i,r])=>Tg(A,i,r)??[]);const n=Tg(A,"*",e);return n?[n]:[]}const F8=new Set(Tt.map(A=>A.id)),G8=new Set(Eu.map(A=>A.id));function R8(A){const e=A.options.source;if(typeof e=="string")return e}function U8(A){const e=Object.entries(T8(A));return{tools:du(e.filter(([,t])=>t==="allow").map(([t])=>t)),permission:Object.fromEntries(e.filter(([,t])=>t!=="allow"))}}function T8(A){return Array.isArray(A)?A.reduce((e,t)=>{const n=xt(t),i=Xt(n.permission),r=Xt(n.action);if(!i||!r)return e;const o=Xt(n.pattern)||"*";if(o==="*")return{...e,[i]:r};const s=e[i],a=s&&typeof s=="object"&&!Array.isArray(s)?s:{};return{...e,[i]:{...a,[o]:r}}},{}):xt(A)}function O8(A,e){return(A.overlay.collections.agent??[]).find(t=>t.key===e)}function Vi(A){return A.displayName??E1(A.name)}function K8(A){return A.model?`${A.model.providerID}/${A.model.modelID}`:""}function Og(A,e){return!(A.native||e?.inherited||e?.editable===!1||R8(A)==="organization")}function q8(A){const e=xe(),t=()=>e.data(),n=R(()=>e.query()?.scope??"project"),[i,r]=T(),[o,s]=T(!0),[a,l]=T(!1),[c,g]=T("reviewer"),[d,Q]=T(""),[B,C]=T("subagent"),[I,f]=T(""),[u,p]=T(""),[w,m]=T(""),[y,M]=T([]),[v,N]=T(""),[_,F]=T("external_directory"),[x,S]=T(""),[G,K]=T("ask"),[q,J]=T({}),[P,j]=T(),[oA,aA]=T("closed"),[z,dA]=T(""),[sA,lA]=T(""),[EA,CA]=T(""),[UA,kA]=T([]),bA=R(()=>{const $=t();if(!$)return[];const tA=new Set([...Object.keys($.effective.provider??{}),...$.providers.connected]);return $.providers.all.filter(BA=>tA.has(BA.id)).filter(BA=>Object.keys(BA.models).length>0).sort(S8)}),PA=R(()=>bA().flatMap($=>Object.values($.models).map(tA=>({id:`${$.id}/${tA.id}`,provider:$,model:tA})))),re=R(()=>t()?.modelState.favorite??[]),Z=$=>re().some(tA=>x8($,tA)),D=R(()=>{const $=z().trim().toLowerCase();return PA().filter(tA=>$?`${tA.id} ${tA.model.name} ${tA.provider.name}`.toLowerCase().includes($):!0).sort((tA,BA)=>{const GA=Number(Z(BA))-Number(Z(tA));if(GA!==0)return GA;const XA=tA.model.name.localeCompare(BA.model.name);if(XA!==0)return XA;const HA=tA.provider.name.localeCompare(BA.provider.name);return HA!==0?HA:tA.id.localeCompare(BA.id)})}),uA=$=>{if(typeof $=="string")return PA().find(tA=>tA.id===$||`${tA.model.providerID}/${tA.model.id}`===$)},pA=R(()=>uA(I())),VA=R(()=>{const $=t();if(!$)return[];const tA=EA().trim().toLowerCase(),BA=new Map($.toolDetails.map(GA=>[GA.id,GA]));return $.tools.map(GA=>({id:GA,detail:BA.get(GA)})).filter(GA=>tA?`${GA.id} ${Et(GA.id)} ${e0(GA).join(" ")}`.toLowerCase().includes(tA):!0).sort((GA,XA)=>Et(GA.id).localeCompare(Et(XA.id)))}),ge=R(()=>new Set(UA())),u1=R(()=>Object.entries(q()).flatMap(([$,tA])=>oQ($,tA))),G1=R(()=>Tt.map($=>{const tA=q()[$.id],BA=xt(tA);return{...$,action:rQ(typeof tA=="string"?tA:BA["*"]),rules:Object.entries(BA).filter(([GA])=>GA!=="*").flatMap(([GA,XA])=>Tg($.id,GA,XA)??[])}})),wt=R(()=>t0.map($=>{const tA=q()[$.id],BA=xt(tA);return{...$,action:rQ(typeof tA=="string"?tA:BA["*"])}})),yt=R(()=>Object.entries(q()).filter(([$])=>!G8.has($)).flatMap(([$,tA])=>oQ($,tA)).sort(($,tA)=>$.tool.localeCompare(tA.tool)||$.pattern.localeCompare(tA.pattern))),Ve=R(()=>Tt.find($=>$.id===_())??Tt[0]);function R1($="reviewer"){g($),Q(""),C("subagent"),f(""),p(""),m(""),M([]),N(""),J({}),j(void 0),l(!1),aA("closed"),F("external_directory"),S(""),K("ask"),dA(""),lA(""),CA(""),kA([])}iA(()=>{A?.()||i()!==""&&(R1(),s(!0),r(""))}),iA(()=>{const $=t(),tA=A?.();if(!$||!tA||i()===tA)return;R1(tA),s(!1),r(tA);const BA=$.agents.find(i1=>i1.name===tA);if(!BA){e.fail(`Agent not found: ${tA}`);return}const GA=O8($,tA),XA=Og(BA,GA);e.fail(""),s(!0),l(!XA);const HA=xt(GA?.value),h1=U8(HA.permission??(XA?void 0:BA.permission)),I1=_8(HA.steps)??BA.steps;g(BA.name),Q(Xt(HA.description)||BA.description||""),C(n8(Xt(HA.mode)||BA.mode)),f(Xt(HA.model)||K8(BA)),p(Xt(HA.color)||BA.color||""),m(I1?String(I1):""),M(h1.tools),J(h1.permission),N(Xt(HA.prompt)||BA.prompt||"")});function Ie(){aA("closed")}function fe(){return a()?(e.fail("Inspected agents are read-only."),!1):!0}function U1(){const $=n1();$&&(j(void 0),aA("markdown"),e.run("Previewing agent",()=>k3(e.target(),$).then(j),{refetch:!1}))}function Ht(){fe()&&(dA(""),lA(I()),aA("model"))}function T1($){lA($.id)}function ot(){if(!fe())return;const $=sA();if(!$){e.fail("Select a model before saving the agent model field.");return}f($),Ie()}function O1(){fe()&&f("")}function Yt(){fe()&&(CA(""),kA(y()),aA("tools"))}function cA($){if(!fe())return;const tA=new Set(UA());tA.has($)?tA.delete($):tA.add($),kA(du(tA))}function wA(){fe()&&(M(UA()),Ie())}function jA(){fe()&&M([])}function ve($){fe()&&(F($),S(""),K("ask"),aA("permission"))}function je($,tA){if(!fe())return;const BA={...q()};if(!F8.has($)){BA[$]=tA,J(BA);return}const GA=xt(BA[$]);BA[$]={...GA,"*":tA},J(BA)}function ee(){if(!fe())return;const $=LA(x());if(!$){e.fail(`Enter a ${Ve().noun} pattern before saving.`);return}const tA=_(),BA={...q()},GA=BA[tA],XA=GA&&typeof GA=="object"&&!Array.isArray(GA)?{...GA}:{};XA[$]=G(),BA[tA]=XA,J(BA),Ie()}function we($){if(!fe())return;const tA={...q()};if($.pattern==="*"){const GA={...xt(tA[$.tool])};if(Object.keys(GA).length){delete GA["*"],Object.keys(GA).length?tA[$.tool]=GA:delete tA[$.tool],J(tA);return}delete tA[$.tool],J(tA);return}const BA={...xt(tA[$.tool])};delete BA[$.pattern],Object.keys(BA).length?tA[$.tool]=BA:delete tA[$.tool],J(tA)}function ze($){if(!fe())return;const tA=LA(v());N(tA?`${tA}
|
|
20
|
+
`);try{J=JSON.parse(j),P=!0}catch{J=j}}P&&(i&&await i(J),n&&(J=await n(J))),t?.({data:J,event:q,id:g,retry:C}),K.length&&(yield J)}}}finally{f.removeEventListener("abort",N),M.releaseLock()}break}catch(p){if(e?.(p),o!==void 0&&I>=o)break;const w=Math.min(C*2**(I-1),s??3e4);await d(w)}}}()}},y2=A=>{switch(A){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},D2=A=>{switch(A){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},k2=A=>{switch(A){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},VC=({allowReserved:A,explode:e,name:t,style:n,value:i})=>{if(!e){const s=(A?i:i.map(a=>encodeURIComponent(a))).join(D2(n));switch(n){case"label":return`.${s}`;case"matrix":return`;${t}=${s}`;case"simple":return s;default:return`${t}=${s}`}}const r=y2(n),o=i.map(s=>n==="label"||n==="simple"?A?s:encodeURIComponent(s):fa({allowReserved:A,name:t,value:s})).join(r);return n==="label"||n==="matrix"?r+o:o},fa=({allowReserved:A,name:e,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${A?t:encodeURIComponent(t)}`},jC=({allowReserved:A,explode:e,name:t,style:n,value:i,valueOnly:r})=>{if(i instanceof Date)return r?i.toISOString():`${t}=${i.toISOString()}`;if(n!=="deepObject"&&!e){let a=[];Object.entries(i).forEach(([c,g])=>{a=[...a,c,A?g:encodeURIComponent(g)]});const l=a.join(",");switch(n){case"form":return`${t}=${l}`;case"label":return`.${l}`;case"matrix":return`;${t}=${l}`;default:return l}}const o=k2(n),s=Object.entries(i).map(([a,l])=>fa({allowReserved:A,name:n==="deepObject"?`${t}[${a}]`:a,value:l})).join(o);return n==="label"||n==="matrix"?o+s:s},b2=/\{[^{}]+\}/g,v2=({path:A,url:e})=>{let t=e;const n=e.match(b2);if(n)for(const i of n){let r=!1,o=i.substring(1,i.length-1),s="simple";o.endsWith("*")&&(r=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),s="label"):o.startsWith(";")&&(o=o.substring(1),s="matrix");const a=A[o];if(a==null)continue;if(Array.isArray(a)){t=t.replace(i,VC({explode:r,name:o,style:s,value:a}));continue}if(typeof a=="object"){t=t.replace(i,jC({explode:r,name:o,style:s,value:a,valueOnly:!0}));continue}if(s==="matrix"){t=t.replace(i,`;${fa({name:o,value:a})}`);continue}const l=encodeURIComponent(s==="label"?`.${a}`:a);t=t.replace(i,l)}return t},M2=({baseUrl:A,path:e,query:t,querySerializer:n,url:i})=>{const r=i.startsWith("/")?i:`/${i}`;let o=(A??"")+r;e&&(o=v2({path:e,url:o}));let s=t?n(t):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function Pd(A){const e=A.body!==void 0;if(e&&A.bodySerializer)return"serializedBody"in A?A.serializedBody!==void 0&&A.serializedBody!==""?A.serializedBody:null:A.body!==""?A.body:null;if(e)return A.body}const N2=async(A,e)=>{const t=typeof e=="function"?await e(A):e;if(t)return A.scheme==="bearer"?`Bearer ${t}`:A.scheme==="basic"?`Basic ${btoa(t)}`:t},S2={bodySerializer:A=>JSON.stringify(A,(e,t)=>typeof t=="bigint"?t.toString():t)},zC=({parameters:A={},...e}={})=>n=>{const i=[];if(n&&typeof n=="object")for(const r in n){const o=n[r];if(o==null)continue;const s=A[r]||e;if(Array.isArray(o)){const a=VC({allowReserved:s.allowReserved,explode:!0,name:r,style:"form",value:o,...s.array});a&&i.push(a)}else if(typeof o=="object"){const a=jC({allowReserved:s.allowReserved,explode:!0,name:r,style:"deepObject",value:o,...s.object});a&&i.push(a)}else{const a=fa({allowReserved:s.allowReserved,name:r,value:o});a&&i.push(a)}}return i.join("&")},x2=A=>{if(!A)return"stream";const e=A.split(";")[0]?.trim();if(e){if(e.startsWith("application/json")||e.endsWith("+json"))return"json";if(e==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>e.startsWith(t)))return"blob";if(e.startsWith("text/"))return"text"}},L2=(A,e)=>e?!!(A.headers.has(e)||A.query?.[e]||A.headers.get("Cookie")?.includes(`${e}=`)):!1,_2=async({security:A,...e})=>{for(const t of A){if(L2(e,t.name))continue;const n=await N2(t,e.auth);if(!n)continue;const i=t.name??"Authorization";switch(t.in){case"query":e.query||(e.query={}),e.query[i]=n;break;case"cookie":e.headers.append("Cookie",`${i}=${n}`);break;default:e.headers.set(i,n);break}}},Vd=A=>M2({baseUrl:A.baseUrl,path:A.path,query:A.query,querySerializer:typeof A.querySerializer=="function"?A.querySerializer:zC(A.querySerializer),url:A.url}),jd=(A,e)=>{const t={...A,...e};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=$C(A.headers,e.headers),t},F2=A=>{const e=[];return A.forEach((t,n)=>{e.push([n,t])}),e},$C=(...A)=>{const e=new Headers;for(const t of A){if(!t)continue;const n=t instanceof Headers?F2(t):Object.entries(t);for(const[i,r]of n)if(r===null)e.delete(i);else if(Array.isArray(r))for(const o of r)e.append(i,o);else r!==void 0&&e.set(i,typeof r=="object"?JSON.stringify(r):r)}return e};class ul{fns=[];clear(){this.fns=[]}eject(e){const t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){const t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e=="number"?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){const n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}}const G2=()=>({error:new ul,request:new ul,response:new ul}),R2=zC({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),U2={"Content-Type":"application/json"},WC=(A={})=>({...S2,headers:U2,parseAs:"auto",querySerializer:R2,...A}),ZC=(A={})=>{let e=jd(WC(),A);const t=()=>({...e}),n=l=>(e=jd(e,l),t()),i=G2(),r=async l=>{const c={...e,...l,fetch:l.fetch??e.fetch??globalThis.fetch,headers:$C(e.headers,l.headers),serializedBody:void 0};c.security&&await _2({...c,security:c.security}),c.requestValidator&&await c.requestValidator(c),c.body!==void 0&&c.bodySerializer&&(c.serializedBody=c.bodySerializer(c.body)),(c.body===void 0||c.serializedBody==="")&&c.headers.delete("Content-Type");const g=Vd(c);return{opts:c,url:g}},o=async l=>{const{opts:c,url:g}=await r(l),d={redirect:"follow",...c,body:Pd(c)};let Q=new Request(g,d);for(const m of i.request.fns)m&&(Q=await m(Q,c));const B=c.fetch;let C;try{C=await B(Q)}catch(m){let y=m;for(const M of i.error.fns)M&&(y=await M(m,void 0,Q,c));if(y=y||{},c.throwOnError)throw y;return c.responseStyle==="data"?void 0:{error:y,request:Q,response:void 0}}for(const m of i.response.fns)m&&(C=await m(C,Q,c));const I={request:Q,response:C};if(C.ok){const m=(c.parseAs==="auto"?x2(C.headers.get("Content-Type")):c.parseAs)??"json";if(C.status===204||C.headers.get("Content-Length")==="0"){let M;switch(m){case"arrayBuffer":case"blob":case"text":M=await C[m]();break;case"formData":M=new FormData;break;case"stream":M=C.body;break;default:M={};break}return c.responseStyle==="data"?M:{data:M,...I}}let y;switch(m){case"arrayBuffer":case"blob":case"formData":case"text":y=await C[m]();break;case"json":{const M=await C.text();y=M?JSON.parse(M):{};break}case"stream":return c.responseStyle==="data"?C.body:{data:C.body,...I}}return m==="json"&&(c.responseValidator&&await c.responseValidator(y),c.responseTransformer&&(y=await c.responseTransformer(y))),c.responseStyle==="data"?y:{data:y,...I}}const f=await C.text();let u;try{u=JSON.parse(f)}catch{}const p=u??f;let w=p;for(const m of i.error.fns)m&&(w=await m(p,C,Q,c));if(w=w||{},c.throwOnError)throw w;return c.responseStyle==="data"?void 0:{error:w,...I}},s=l=>c=>o({...c,method:l}),a=l=>async c=>{const{opts:g,url:d}=await r(c);return w2({...g,body:g.body,headers:g.headers,method:l,onRequest:async(Q,B)=>{let C=new Request(Q,B);for(const I of i.request.fns)I&&(C=await I(C,g));return C},serializedBody:Pd(g),url:d})};return{buildUrl:Vd,connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:t,head:s("HEAD"),interceptors:i,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:o,setConfig:n,sse:{connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),head:a("HEAD"),options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),trace:a("TRACE")},trace:s("TRACE")}},T2={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},O2=Object.entries(T2),XC=(A,e)=>{e||(e=new Map);for(const t of A)"in"in t?t.key&&e.set(t.key,{in:t.in,map:t.map}):"key"in t?e.set(t.key,{map:t.map}):t.args&&XC(t.args,e);return e},K2=A=>{for(const[e,t]of Object.entries(A))t&&typeof t=="object"&&!Object.keys(t).length&&delete A[e]},L=(A,e)=>{const t={body:{},headers:{},path:{},query:{}},n=XC(e);let i;for(const[r,o]of A.entries())if(e[r]&&(i=e[r]),!!i)if("in"in i)if(i.key){const s=n.get(i.key),a=s.map||i.key;s.in&&(t[s.in][a]=o)}else t.body=o;else for(const[s,a]of Object.entries(o??{})){const l=n.get(s);if(l)if(l.in){const c=l.map||s;t[l.in][c]=a}else t[l.map]=a;else{const c=O2.find(([g])=>s.startsWith(g));if(c){const[g,d]=c;t[d][s.slice(g.length)]=a}else if("allowExtra"in i&&i.allowExtra){for(const[g,d]of Object.entries(i.allowExtra))if(d){t[g][s]=a;break}}}}return K2(t),t},q2=ZC(WC({baseUrl:"http://localhost:4096"}));class AA{client;constructor(e){this.client=e?.client??q2}}class J2{defaultKey="default";instances=new Map;get(e){const t=this.instances.get(e??this.defaultKey);if(!t)throw new Error('No SDK client found. Create one with "new KiloClient()" to fix this error.');return t}set(e,t){this.instances.set(t??this.defaultKey,e)}}class H2 extends AA{remove(e,t){const n=L([e],[{args:[{in:"path",key:"providerID"}]}]);return(t?.client??this.client).delete({url:"/auth/{providerID}",...t,...n})}set(e,t){const n=L([e],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return(t?.client??this.client).put({url:"/auth/{providerID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}let Y2=class extends AA{log(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return(t?.client??this.client).post({url:"/log",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}agents(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/agent",...t,...n})}skills(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/skill",...t,...n})}};class P2 extends AA{moveSession(e,t){const n=L([e],[{args:[{in:"body",key:"sessionID"},{in:"body",key:"destination"},{in:"body",key:"moveChanges"}]}]);return(t?.client??this.client).post({url:"/experimental/control-plane/move-session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class V2 extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/capabilities",...t,...n})}}class j2 extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/console",...t,...n})}listOrgs(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/console/orgs",...t,...n})}switchOrg(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"accountID"},{in:"body",key:"orgID"}]}]);return(t?.client??this.client).post({url:"/experimental/console/switch",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class z2 extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"projectID"},{in:"query",key:"worktrees"},{in:"query",key:"current"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"cursor"},{in:"query",key:"search"},{in:"query",key:"limit"},{in:"query",key:"archived"}]}]);return(t?.client??this.client).get({url:"/experimental/session",...t,...n})}background(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/experimental/session/{sessionID}/background",...t,...n})}}class $2 extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/resource",...t,...n})}}class W2 extends AA{generateName(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"context"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy/generate-name",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Z2 extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace/adapter",...t,...n})}}class X2 extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"type"},{in:"body",key:"branch"},{in:"body",key:"extra"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}syncList(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace/sync-list",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace/status",...t,...n})}remove(e,t){const n=L([e],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/experimental/workspace/{id}",...t,...n})}warp(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"sessionID"},{in:"body",key:"copyChanges"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace/warp",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_adapter;get adapter(){return this._adapter??=new Z2({client:this.client})}}class AD extends AA{_controlPlane;get controlPlane(){return this._controlPlane??=new P2({client:this.client})}_capabilities;get capabilities(){return this._capabilities??=new V2({client:this.client})}_console;get console(){return this._console??=new j2({client:this.client})}_session;get session(){return this._session??=new z2({client:this.client})}_resource;get resource(){return this._resource??=new $2({client:this.client})}_projectCopy;get projectCopy(){return this._projectCopy??=new W2({client:this.client})}_workspace;get workspace(){return this._workspace??=new X2({client:this.client})}}class eD extends AA{get(e){return(e?.client??this.client).get({url:"/global/config",...e})}update(e,t){const n=L([e],[{args:[{key:"config",map:"body"}]}]);return(t?.client??this.client).patch({url:"/global/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class tD extends AA{health(e){return(e?.client??this.client).get({url:"/global/health",...e})}event(e){return(e?.client??this.client).sse.get({url:"/global/event",...e})}dispose(e){return(e?.client??this.client).post({url:"/global/dispose",...e})}upgrade(e,t){const n=L([e],[{args:[{in:"body",key:"target"}]}]);return(t?.client??this.client).post({url:"/global/upgrade",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_config;get config(){return this._config??=new eD({client:this.client})}}let nD=class extends AA{subscribe(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).sse.get({url:"/event",...t,...n})}};class iD extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"config",map:"body"}]}]);return(t?.client??this.client).patch({url:"/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}warnings(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/warnings",...t,...n})}providers(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/providers",...t,...n})}overlay(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"}]}]);return(t?.client??this.client).get({url:"/config/overlay",...t,...n})}overlayUpdate(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"scope"},{in:"body",key:"set"},{in:"body",key:"unset"},{in:"body",key:"expected"}]}]);return(t?.client??this.client).patch({url:"/config/overlay",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}sources(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/sources",...t,...n})}effective(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/effective",...t,...n})}rules(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"}]}]);return(t?.client??this.client).get({url:"/config/rules",...t,...n})}rulesUpdate(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"scope"},{in:"body",key:"content"}]}]);return(t?.client??this.client).put({url:"/config/rules",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}modelState(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/model-state",...t,...n})}modelStateUpdate(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"favorite"}]}]);return(t?.client??this.client).patch({url:"/config/model-state",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class rD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return(t?.client??this.client).get({url:"/experimental/tool",...t,...n})}ids(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/tool/ids",...t,...n})}}class oD extends AA{remove(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeRemoveInput",map:"body"}]}]);return(t?.client??this.client).delete({url:"/experimental/worktree",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeCreateInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/experimental/worktree",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reset(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeResetInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/experimental/worktree/reset",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}diff(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff",...t,...n})}diffSummary(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff/summary",...t,...n})}diffFile(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"},{in:"query",key:"file"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff/file",...t,...n})}}class sD extends AA{text(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"pattern"}]}]);return(t?.client??this.client).get({url:"/find",...t,...n})}files(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/find/file",...t,...n})}symbols(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"}]}]);return(t?.client??this.client).get({url:"/find/symbol",...t,...n})}}let aD=class extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/file",...t,...n})}read(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/file/content",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/file/status",...t,...n})}};class lD extends AA{dispose(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/instance/dispose",...t,...n})}reload(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/instance/reload",...t,...n})}}class gD extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/path",...t,...n})}}let cD=class extends AA{raw(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs/diff/raw",...t,...n})}};class dD extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs/status",...t,...n})}diff(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"mode"},{in:"query",key:"context"}]}]);return(t?.client??this.client).get({url:"/vcs/diff",...t,...n})}apply(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"patch"}]}]);return(t?.client??this.client).post({url:"/vcs/apply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_diff;get diff2(){return this._diff??=new cD({client:this.client})}}class QD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/command",...t,...n})}}class BD extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/lsp",...t,...n})}}class ED extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/formatter",...t,...n})}}class CD extends AA{remove(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/mcp/{name}/auth",...t,...n})}start(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth",...t,...n})}callback(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth/callback",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}authenticate(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...t,...n})}}class uD extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/mcp",...t,...n})}add(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return(t?.client??this.client).post({url:"/mcp",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connect(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/connect",...t,...n})}disconnect(e,t){const n=L([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/disconnect",...t,...n})}_auth;get auth(){return this._auth??=new CD({client:this.client})}}class hD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project",...t,...n})}current(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project/current",...t,...n})}initGit(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/project/git/init",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return(t?.client??this.client).patch({url:"/project/{projectID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}directories(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project/{projectID}/directories",...t,...n})}}class ID extends AA{shells(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty/shells",...t,...n})}list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"},{in:"body",key:"size"}]}]);return(t?.client??this.client).post({url:"/pty",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}remove(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/pty/{ptyID}",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty/{ptyID}",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"size"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).put({url:"/pty/{ptyID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connectToken(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/pty/{ptyID}/connect-token",...t,...n})}connect(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"cursor"},{in:"query",key:"ticket"}]}]);return(t?.client??this.client).get({url:"/pty/{ptyID}/connect",...t,...n})}}class fD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/question",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"answers"}]}]);return(t?.client??this.client).post({url:"/question/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/question/{requestID}/reject",...t,...n})}}class pD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/permission",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"reply"},{in:"body",key:"message"},{in:"body",key:"interactive"}]}]);return(t?.client??this.client).post({url:"/permission/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}saveAlwaysRules(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"approvedAlways"},{in:"body",key:"deniedAlways"}]}]);return(t?.client??this.client).post({url:"/permission/{requestID}/always-rules",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}allowEverything(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enable"},{in:"body",key:"requestID"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/permission/allow-everything",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}respond(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"response"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class mD extends AA{authorize(e,t){const n=L([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"inputs"}]}]);return(t?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}callback(e,t){const n=L([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class wD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/provider",...t,...n})}auth(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/provider/auth",...t,...n})}_oauth;get oauth(){return this._oauth??=new mD({client:this.client})}}class yD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"},{in:"query",key:"path"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/session",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"parentID"},{in:"body",key:"title"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"metadata"},{in:"body",key:"permission"},{in:"body",key:"platform"},{in:"body",key:"workspaceID"},{in:"body",key:"sandboxInheritanceToken"}]}]);return(t?.client??this.client).post({url:"/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/status",...t,...n})}delete(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"metadata"},{in:"body",key:"permission"},{in:"body",key:"time"}]}]);return(t?.client??this.client).patch({url:"/session/{sessionID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}children(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/children",...t,...n})}todo(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/todo",...t,...n})}diff(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"messageID"},{in:"query",key:"file"},{in:"query",key:"full"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/diff",...t,...n})}messages(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"limit"},{in:"query",key:"before"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/message",...t,...n})}prompt(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"editorContext"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}deleteMessage(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}",...t,...n})}message(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...t,...n})}fork(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/fork",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}abort(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/abort",...t,...n})}init(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/init",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}unshare(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/share",...t,...n})}share(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/share",...t,...n})}summarize(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/summarize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}promptAsync(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"editorContext"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}command(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"arguments"},{in:"body",key:"command"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/command",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}shell(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"command"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/shell",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}revert(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/revert",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}unrevert(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/unrevert",...t,...n})}viewed(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"viewer"},{in:"body",key:"attached"},{in:"body",key:"visible"}]}]);return(t?.client??this.client).post({url:"/session/viewed",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class DD extends AA{delete(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"part",map:"body"}]}]);return(t?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class kD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/sync/history",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class bD extends AA{start(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/sync/start",...t,...n})}replay(e,t){const n=L([e],[{args:[{in:"query",key:"query_directory",map:"directory"},{in:"query",key:"workspace"},{in:"body",key:"body_directory",map:"directory"},{in:"body",key:"events"}]}]);return(t?.client??this.client).post({url:"/sync/replay",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}steal(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/sync/steal",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_history;get history(){return this._history??=new kD({client:this.client})}}class vD extends AA{next(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/control/next",...t,...n})}response(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/tui/control/response",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class MD extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/config",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"},{in:"body",key:"$schema"},{in:"body",key:"theme"},{in:"body",key:"keybinds"},{in:"body",key:"plugin"},{in:"body",key:"plugin_enabled"},{in:"body",key:"title_icon"},{in:"body",key:"scroll_speed"},{in:"body",key:"scroll_acceleration"},{in:"body",key:"diff_style"},{in:"body",key:"mouse"},{in:"body",key:"attention"}]}]);return(t?.client??this.client).patch({url:"/tui/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class ND extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/keybinds",...t,...n})}}class SD extends AA{appendPrompt(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"}]}]);return(t?.client??this.client).post({url:"/tui/append-prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}openHelp(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-help",...t,...n})}openSessions(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-sessions",...t,...n})}openThemes(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-themes",...t,...n})}openModels(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-models",...t,...n})}submitPrompt(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/submit-prompt",...t,...n})}clearPrompt(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/clear-prompt",...t,...n})}executeCommand(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"}]}]);return(t?.client??this.client).post({url:"/tui/execute-command",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}showToast(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return(t?.client??this.client).post({url:"/tui/show-toast",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}publish(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/tui/publish",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}selectSession(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/tui/select-session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_control;get control(){return this._control??=new vD({client:this.client})}_config;get config(){return this._config??=new MD({client:this.client})}_keybind;get keybind(){return this._keybind??=new ND({client:this.client})}}class xD extends AA{preview(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"scope"},{in:"body",key:"description"},{in:"body",key:"mode"},{in:"body",key:"model"},{in:"body",key:"color"},{in:"body",key:"steps"},{in:"body",key:"tools"},{in:"body",key:"permission"},{in:"body",key:"prompt"}]}]);return(t?.client??this.client).post({url:"/agent-builder/preview",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}save(e,t){const n=L([e],[{args:[{in:"path",key:"path_id",map:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"body_id",map:"id"},{in:"body",key:"scope"},{in:"body",key:"description"},{in:"body",key:"mode"},{in:"body",key:"model"},{in:"body",key:"color"},{in:"body",key:"steps"},{in:"body",key:"tools"},{in:"body",key:"permission"},{in:"body",key:"prompt"}]}]);return(t?.client??this.client).put({url:"/agent-builder/{id}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class LD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process/{processID}",...t,...n})}logs(e,t){const n=L([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process/{processID}/logs",...t,...n})}stop(e,t){const n=L([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/{processID}/stop",...t,...n})}restart(e,t){const n=L([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/{processID}/restart",...t,...n})}stopSession(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/session/{sessionID}/stop",...t,...n})}}class _D extends AA{generate(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"prompt"},{in:"body",key:"providerID"},{in:"body",key:"modelID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/branch-name",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class FD extends AA{generate(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"path"},{in:"body",key:"selectedFiles"},{in:"body",key:"previousMessage"},{in:"body",key:"language"}]}]);return(t?.client??this.client).post({url:"/commit-message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class GD extends AA{enhance(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"}]}]);return(t?.client??this.client).post({url:"/enhance-prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class RD extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/status",...t,...n})}warnings(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/warnings",...t,...n})}models(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/models",...t,...n})}consent(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enabled"}]}]);return(t?.client??this.client).put({url:"/indexing/consent",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class UD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/interactive-terminal",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/interactive-terminal/{terminalID}",...t,...n})}write(e,t){const n=L([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"interactiveTerminalWriteInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/input",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}resize(e,t){const n=L([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"interactiveTerminalResizeInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/resize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}close(e,t){const n=L([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/close",...t,...n})}}class TD extends AA{transcriptions(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"model"},{in:"body",key:"input_audio"},{in:"body",key:"language"},{in:"body",key:"prompt"},{in:"body",key:"temperature"}]}]);return(t?.client??this.client).post({url:"/kilo/audio/transcriptions",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class OD extends AA{images(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/models/images",...t,...n})}transcriptions(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/models/transcriptions",...t,...n})}}class KD extends AA{set(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"organizationId"}]}]);return(t?.client??this.client).post({url:"/kilo/organization",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class qD extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/claw/status",...t,...n})}chatCredentials(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/claw/chat-credentials",...t,...n})}}class JD extends AA{get(e,t){const n=L([e],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/cloud/session/{id}",...t,...n})}import(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionId"}]}]);return(t?.client??this.client).post({url:"/kilo/cloud/session/import",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class HD extends AA{_session;get session(){return this._session??=new JD({client:this.client})}}class YD extends AA{profile(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/profile",...t,...n})}authStatus(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/auth-status",...t,...n})}modes(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/modes",...t,...n})}fim(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"prefix"},{in:"body",key:"suffix"},{in:"body",key:"provider"},{in:"body",key:"model"},{in:"body",key:"maxTokens"},{in:"body",key:"temperature"}]}]);return(t?.client??this.client).sse.post({url:"/kilo/fim",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}edit(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"provider"},{in:"body",key:"model"},{in:"body",key:"maxTokens"},{in:"body",key:"currentFilePath"},{in:"body",key:"currentFileContent"},{in:"body",key:"cursorLine"},{in:"body",key:"cursorCharacter"},{in:"body",key:"editableRegionStartLine"},{in:"body",key:"editableRegionEndLine"},{in:"body",key:"recentlyViewedSnippets"},{in:"body",key:"editDiffHistory"}]}]);return(t?.client??this.client).post({url:"/kilo/edit",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}notifications(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/notifications",...t,...n})}cloudSessions(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"cursor"},{in:"query",key:"limit"},{in:"query",key:"gitUrl"}]}]);return(t?.client??this.client).get({url:"/kilo/cloud-sessions",...t,...n})}_audio;get audio(){return this._audio??=new TD({client:this.client})}_models;get models(){return this._models??=new OD({client:this.client})}_organization;get organization(){return this._organization??=new KD({client:this.client})}_claw;get claw(){return this._claw??=new qD({client:this.client})}_cloud;get cloud(){return this._cloud??=new HD({client:this.client})}}class PD extends AA{snapshot(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/kilocode/heap/snapshot",...t,...n})}}class VD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/notebook",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"result"}]}]);return(t?.client??this.client).post({url:"/kilocode/notebook/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"error"}]}]);return(t?.client??this.client).post({url:"/kilocode/notebook/{requestID}/reject",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class jD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/agent-manager",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"result"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent-manager/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"error"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent-manager/{requestID}/reject",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class zD extends AA{project(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"worktree"},{in:"body",key:"vcs"},{in:"body",key:"name"},{in:"body",key:"iconUrl"},{in:"body",key:"iconColor"},{in:"body",key:"timeCreated"},{in:"body",key:"timeUpdated"},{in:"body",key:"timeInitialized"},{in:"body",key:"sandboxes"},{in:"body",key:"commands"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/project",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}session(e,t){const n=L([e],[{args:[{in:"query",key:"query_directory",map:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"projectID"},{in:"body",key:"force"},{in:"body",key:"workspaceID"},{in:"body",key:"parentID"},{in:"body",key:"slug"},{in:"body",key:"body_directory",map:"directory"},{in:"body",key:"title"},{in:"body",key:"version"},{in:"body",key:"shareURL"},{in:"body",key:"summary"},{in:"body",key:"revert"},{in:"body",key:"permission"},{in:"body",key:"timeCreated"},{in:"body",key:"timeUpdated"},{in:"body",key:"timeCompacting"},{in:"body",key:"timeArchived"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}message(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"sessionID"},{in:"body",key:"timeCreated"},{in:"body",key:"data"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}part(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"messageID"},{in:"body",key:"sessionID"},{in:"body",key:"timeCreated"},{in:"body",key:"data"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/part",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class $D extends AA{commandFiles(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/command/files",...t,...n})}removeCommand(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"location"}]}]);return(t?.client??this.client).post({url:"/kilocode/command/remove",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}removeSkill(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"location"}]}]);return(t?.client??this.client).post({url:"/kilocode/skill/remove",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}removeAgent(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"scope"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent/remove",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}sessionModelUsage(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/model-usage",...t,...n})}_heap;get heap(){return this._heap??=new PD({client:this.client})}_notebook;get notebook(){return this._notebook??=new VD({client:this.client})}_agentManager;get agentManager(){return this._agentManager??=new jD({client:this.client})}_sessionImport;get sessionImport(){return this._sessionImport??=new zD({client:this.client})}}class WD extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/anaconda-desktop/status",...t,...n})}open(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/kilocode/anaconda-desktop/open",...t,...n})}sync(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"acknowledgeToolLimitations"}]}]);return(t?.client??this.client).post({url:"/kilocode/anaconda-desktop/sync",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class ZD extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/network",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/network/{requestID}/reply",...t,...n})}reject(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/network/{requestID}/reject",...t,...n})}}class XD extends AA{enable(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/remote/enable",...t,...n})}disable(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/remote/disable",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/remote/status",...t,...n})}}class Ak extends AA{support(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/sandbox/support",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/sandbox",...t,...n})}toggle(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/sandbox/toggle",...t,...n})}}class ek extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/suggestion",...t,...n})}accept(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"index"}]}]);return(t?.client??this.client).post({url:"/suggestion/{requestID}/accept",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}dismiss(e,t){const n=L([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/suggestion/{requestID}/dismiss",...t,...n})}}class tk extends AA{capture(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"event"},{in:"body",key:"properties"}]}]);return(t?.client??this.client).post({url:"/telemetry/capture",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}setEnabled(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enabled"}]}]);return(t?.client??this.client).post({url:"/telemetry/setEnabled",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class nk extends AA{status(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/memory/status",...t,...n})}show(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/memory/show",...t,...n})}enable(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/enable",...t,...n})}disable(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/disable",...t,...n})}configure(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"autoConsolidate"},{in:"body",key:"verbose"}]}]);return(t?.client??this.client).post({url:"/memory/configure",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}rebuild(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/rebuild",...t,...n})}remember(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"},{in:"body",key:"key"},{in:"body",key:"file"},{in:"body",key:"section"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/remember",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}correct(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"},{in:"body",key:"key"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/correct",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}forget(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"query"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/forget",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}purge(e,t){const n=L([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"confirm"}]}]);return(t?.client??this.client).post({url:"/memory/purge",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class ik extends AA{get(e){return(e?.client??this.client).get({url:"/api/health",...e})}}class rk extends AA{get(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/location",...t,...n})}}class ok extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/agent",...t,...n})}}class sk extends AA{stage(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"messageID"},{in:"body",key:"files"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/revert/stage",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}clear(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/revert/clear",...t,...n})}commit(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/revert/commit",...t,...n})}}class ak extends AA{list(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/permission",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"id"},{in:"body",key:"action"},{in:"body",key:"resources"},{in:"body",key:"save"},{in:"body",key:"metadata"},{in:"body",key:"source"},{in:"body",key:"agent"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/permission",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}get(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/permission/{requestID}",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/permission/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class lk extends AA{list(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/question",...t,...n})}reply(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"},{key:"questionV2Reply",map:"body"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/question/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/question/{requestID}/reject",...t,...n})}}class gk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"workspace"},{in:"query",key:"limit"},{in:"query",key:"order"},{in:"query",key:"search"},{in:"query",key:"directory"},{in:"query",key:"project"},{in:"query",key:"subpath"},{in:"query",key:"cursor"}]}]);return(t?.client??this.client).get({url:"/api/session",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"body",key:"id"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"location"}]}]);return(t?.client??this.client).post({url:"/api/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}active(e){return(e?.client??this.client).get({url:"/api/session/active",...e})}get(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}",...t,...n})}switchAgent(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"agent"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/agent",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}switchModel(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"model"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/model",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}prompt(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"id"},{in:"body",key:"prompt"},{in:"body",key:"delivery"},{in:"body",key:"resume"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}compact(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/compact",...t,...n})}wait(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/wait",...t,...n})}context(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/context",...t,...n})}history(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"limit"},{in:"query",key:"after"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/history",...t,...n})}events(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"after"}]}]);return(t?.client??this.client).sse.get({url:"/api/session/{sessionID}/event",...t,...n})}interrupt(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/interrupt",...t,...n})}message(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/message/{messageID}",...t,...n})}messages(e,t){const n=L([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"limit"},{in:"query",key:"order"},{in:"query",key:"cursor"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/message",...t,...n})}_revert;get revert(){return this._revert??=new sk({client:this.client})}_permission;get permission(){return this._permission??=new ak({client:this.client})}_question;get question(){return this._question??=new lk({client:this.client})}}class ck extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/model",...t,...n})}}class dk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/provider",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/provider/{providerID}",...t,...n})}}class Qk extends AA{key(e,t){const n=L([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"},{in:"body",key:"key"},{in:"body",key:"label"}]}]);return(t?.client??this.client).post({url:"/api/integration/{integrationID}/connect/key",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}oauth(e,t){const n=L([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"},{in:"body",key:"methodID"},{in:"body",key:"inputs"},{in:"body",key:"label"}]}]);return(t?.client??this.client).post({url:"/api/integration/{integrationID}/connect/oauth",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Bk extends AA{cancel(e,t){const n=L([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/integration/attempt/{attemptID}",...t,...n})}status(e,t){const n=L([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration/attempt/{attemptID}",...t,...n})}complete(e,t){const n=L([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/api/integration/attempt/{attemptID}/complete",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Ek extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration/{integrationID}",...t,...n})}_connect;get connect(){return this._connect??=new Qk({client:this.client})}_attempt;get attempt(){return this._attempt??=new Bk({client:this.client})}}class Ck extends AA{remove(e,t){const n=L([e],[{args:[{in:"path",key:"credentialID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/credential/{credentialID}",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"credentialID"},{in:"query",key:"location"},{in:"body",key:"label"}]}]);return(t?.client??this.client).patch({url:"/api/credential/{credentialID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}let uk=class extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/permission/request",...t,...n})}};class hk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"projectID"}]}]);return(t?.client??this.client).get({url:"/api/permission/saved",...t,...n})}remove(e,t){const n=L([e],[{args:[{in:"path",key:"id"}]}]);return(t?.client??this.client).delete({url:"/api/permission/saved/{id}",...t,...n})}}class Ik extends AA{_request;get request(){return this._request??=new uk({client:this.client})}_saved;get saved(){return this._saved??=new hk({client:this.client})}}class fk extends AA{read(e,t){const n=L([e],[{args:[{in:"query",key:"location"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/api/fs/read/*",...t,...n})}list(e,t){const n=L([e],[{args:[{in:"query",key:"location"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/api/fs/list",...t,...n})}find(e,t){const n=L([e],[{args:[{in:"query",key:"location"},{in:"query",key:"query"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/api/fs/find",...t,...n})}}class pk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/command",...t,...n})}}class mk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/skill",...t,...n})}}class wk extends AA{subscribe(e){return(e?.client??this.client).sse.get({url:"/api/event",...e})}}class yk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/pty",...t,...n})}create(e,t){const n=L([e],[{args:[{in:"query",key:"location"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"},{in:"body",key:"size"}]}]);return(t?.client??this.client).post({url:"/api/pty",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}remove(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/pty/{ptyID}",...t,...n})}get(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/pty/{ptyID}",...t,...n})}update(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"},{in:"body",key:"title"},{in:"body",key:"size"}]}]);return(t?.client??this.client).put({url:"/api/pty/{ptyID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connectToken(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).post({url:"/api/pty/{ptyID}/connect-token",...t,...n})}connect(e,t){const n=L([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location[directory]"},{in:"query",key:"location[workspace]"},{in:"query",key:"cursor"},{in:"query",key:"ticket"},{in:"query",key:"replayExited"}]}]);return(t?.client??this.client).get({url:"/api/pty/{ptyID}/connect",...t,...n})}}class Dk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/question/request",...t,...n})}}class kk extends AA{_request;get request(){return this._request??=new Dk({client:this.client})}}class bk extends AA{list(e,t){const n=L([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/reference",...t,...n})}}class vk extends AA{remove(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"},{in:"body",key:"directory"},{in:"body",key:"force"}]}]);return(t?.client??this.client).delete({url:"/experimental/project/{projectID}/copy",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}create(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"},{in:"body",key:"strategy"},{in:"body",key:"directory"},{in:"body",key:"name"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}refresh(e,t){const n=L([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy/refresh",...t,...n})}}class Mk extends AA{_health;get health(){return this._health??=new ik({client:this.client})}_location;get location(){return this._location??=new rk({client:this.client})}_agent;get agent(){return this._agent??=new ok({client:this.client})}_session;get session(){return this._session??=new gk({client:this.client})}_model;get model(){return this._model??=new ck({client:this.client})}_provider;get provider(){return this._provider??=new dk({client:this.client})}_integration;get integration(){return this._integration??=new Ek({client:this.client})}_credential;get credential(){return this._credential??=new Ck({client:this.client})}_permission;get permission(){return this._permission??=new Ik({client:this.client})}_fs;get fs(){return this._fs??=new fk({client:this.client})}_command;get command(){return this._command??=new pk({client:this.client})}_skill;get skill(){return this._skill??=new mk({client:this.client})}_event;get event(){return this._event??=new wk({client:this.client})}_pty;get pty(){return this._pty??=new yk({client:this.client})}_question;get question(){return this._question??=new kk({client:this.client})}_reference;get reference(){return this._reference??=new bk({client:this.client})}_projectCopy;get projectCopy(){return this._projectCopy??=new vk({client:this.client})}}class Wc extends AA{static __registry=new J2;constructor(e){super(e),Wc.__registry.set(this,e?.key)}_auth;get auth(){return this._auth??=new H2({client:this.client})}_app;get app(){return this._app??=new Y2({client:this.client})}_experimental;get experimental(){return this._experimental??=new AD({client:this.client})}_global;get global(){return this._global??=new tD({client:this.client})}_event;get event(){return this._event??=new nD({client:this.client})}_config;get config(){return this._config??=new iD({client:this.client})}_tool;get tool(){return this._tool??=new rD({client:this.client})}_worktree;get worktree(){return this._worktree??=new oD({client:this.client})}_find;get find(){return this._find??=new sD({client:this.client})}_file;get file(){return this._file??=new aD({client:this.client})}_instance;get instance(){return this._instance??=new lD({client:this.client})}_path;get path(){return this._path??=new gD({client:this.client})}_vcs;get vcs(){return this._vcs??=new dD({client:this.client})}_command;get command(){return this._command??=new QD({client:this.client})}_lsp;get lsp(){return this._lsp??=new BD({client:this.client})}_formatter;get formatter(){return this._formatter??=new ED({client:this.client})}_mcp;get mcp(){return this._mcp??=new uD({client:this.client})}_project;get project(){return this._project??=new hD({client:this.client})}_pty;get pty(){return this._pty??=new ID({client:this.client})}_question;get question(){return this._question??=new fD({client:this.client})}_permission;get permission(){return this._permission??=new pD({client:this.client})}_provider;get provider(){return this._provider??=new wD({client:this.client})}_session;get session(){return this._session??=new yD({client:this.client})}_part;get part(){return this._part??=new DD({client:this.client})}_sync;get sync(){return this._sync??=new bD({client:this.client})}_tui;get tui(){return this._tui??=new SD({client:this.client})}_agentBuilder;get agentBuilder(){return this._agentBuilder??=new xD({client:this.client})}_backgroundProcess;get backgroundProcess(){return this._backgroundProcess??=new LD({client:this.client})}_branchName;get branchName(){return this._branchName??=new _D({client:this.client})}_commitMessage;get commitMessage(){return this._commitMessage??=new FD({client:this.client})}_enhancePrompt;get enhancePrompt(){return this._enhancePrompt??=new GD({client:this.client})}_indexing;get indexing(){return this._indexing??=new RD({client:this.client})}_interactiveTerminal;get interactiveTerminal(){return this._interactiveTerminal??=new UD({client:this.client})}_kilo;get kilo(){return this._kilo??=new YD({client:this.client})}_kilocode;get kilocode(){return this._kilocode??=new $D({client:this.client})}_anacondaDesktop;get anacondaDesktop(){return this._anacondaDesktop??=new WD({client:this.client})}_network;get network(){return this._network??=new ZD({client:this.client})}_remote;get remote(){return this._remote??=new XD({client:this.client})}_sandbox;get sandbox(){return this._sandbox??=new Ak({client:this.client})}_suggestion;get suggestion(){return this._suggestion??=new ek({client:this.client})}_telemetry;get telemetry(){return this._telemetry??=new tk({client:this.client})}_memory;get memory(){return this._memory??=new nk({client:this.client})}_v2;get v2(){return this._v2??=new Mk({client:this.client})}}function Nk(A,e,t,n){if(!n?.throwOnError||A instanceof Error)return A;if(typeof A=="object"&&A!==null&&Object.keys(A).length>0){const r=A,o=typeof r.data?.message=="string"&&r.data.message||typeof r.message=="string"&&r.message||typeof r.name=="string"&&r.name||zd(t,e);return new Error(o,{cause:{body:A,status:e?.status}})}if(typeof A=="string"&&A.length>0)return new Error(A,{cause:{body:A,status:e?.status}});const i=e?"(empty response body)":"network error (no response)";return new Error(`kilo server ${zd(t,e)}: ${i}`,{cause:{body:A,status:e?.status}})}function zd(A,e){const t=A?.method??"?",n=A?.url??"?",i=e?.status,r=e?.statusText;return`${t} ${n}${i?" → "+i:""}${r?" "+r:""}`}function Sk(A,e,t){if(A)return e&&(A===e||t&&A===t(e))?e:A}function xk(A,e){if(A.method!=="GET"&&A.method!=="HEAD")return A;const t=new URL(A.url);let n=!1;for(const[r,o]of[["x-kilo-directory","directory"],["x-kilo-workspace","workspace"]]){const s=Sk(A.headers.get(r),o==="directory"?e.directory:e.workspace,o==="directory"?encodeURIComponent:void 0);if(s){for(const a of t.pathname.startsWith("/api/")?[o,`location[${o}]`]:[o])t.searchParams.has(a)||t.searchParams.set(a,s);n=!0}}if(!n)return A;const i=new Request(t,A);return i.headers.delete("x-kilo-directory"),i.headers.delete("x-kilo-workspace"),i}function Lk(A){A?.fetch||(A={...A,fetch:n=>fetch(n,{duplex:"half",timeout:!1})}),A?.directory&&(A.headers={...A.headers,"x-kilo-directory":encodeURIComponent(A.directory)}),A?.experimental_workspaceID&&(A.headers={...A.headers,"x-kilo-workspace":A.experimental_workspaceID}),A.duplex="half";const e=ZC(A);return e.interceptors.request.use(t=>xk(t,{directory:A?.directory,workspace:A?.experimental_workspaceID})),e.interceptors.response.use(t=>{if(t.headers.get("content-type")==="text/html")throw new Error("Request is not supported by this version of OpenCode Server (Server responded with text/html)");return t}),e.interceptors.error.use(Nk),new Wc({client:e})}const _k=Array.from({length:20},(A,e)=>4097+e),Fk=1440*60*1e3,Zc="kilo.config.server",Pi={},Xc=window.fetch.bind(window);function Gk(A){const e=new TextEncoder().encode(A);return btoa(String.fromCharCode(...e))}function $d(A){return A?decodeURIComponent(A):""}function pa(A){const e=new URL(A),t=$d(e.username)||"kilo",n=$d(e.password)||"kilo";return e.username="",e.password="",e.search="",e.hash="",{url:e.toString().replace(/\/$/,""),token:Gk(`${t}:${n}`)}}function JA(A){const e=pa(A.url);return Lk({baseUrl:e.url,directory:ma(A.dir),headers:{Authorization:`Basic ${e.token}`},fetch:Xc})}function ma(A){const e=A.trim();if(e)return e}function Ss(A){return A instanceof Error?A.message:typeof A=="string"?A:A==null?"Unknown error":JSON.stringify(A)}function xA(A,e){if(e.error)throw new Error(`${A}: ${Ss(e.error)}`);if(e.data===void 0)throw new Error(`${A}: empty response`);return e.data}async function Rk(A){const t=(await ya(A)).find(n=>n.id===A.project);if(!t)throw new Error(`Project not found: ${A.project}`);return t}async function $1(A,e){return await e.then(t=>{if(t.error){console.warn(`${A}: ${Ss(t.error)}`);return}return t.data}).catch(t=>{console.warn(`${A}: ${Ss(t)}`)})}function Uk(A){if(typeof A!="string")return;const e=A.indexOf("/");if(!(e<=0||e>=A.length-1))return{provider:A.slice(0,e),model:A.slice(e+1)}}function wa(A){const e=ma(A.dir);return e?{directory:e}:void 0}function Tk(A){return A.split("_").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ok(A){return{keybinds:Object.entries(A.keybinds??{}).map(([e,t])=>({id:e,label:Tk(e),group:"Configured",default:t??"none",description:"Configured TUI keybind"}))}}function xs(A){return A.replace(/\\/g,"/").replace(/\/+$/,"")||"/"}function Kk(A,e){const t=xs(A),n=xs(e);return n===t?!0:n.startsWith(`${t}/`)}function Au(A){return A.id!=="global"?!0:xs(A.worktree)!=="/"}function qk(A,e){return[A.worktree,...A.sandboxes].reduce((t,n)=>Kk(n,e)?Math.max(t,xs(n).length):t,-1)}function Jk(A,e){const t=A.find(n=>n.id===e.projectID);return t||A.reduce((n,i)=>{const r=qk(i,e.directory);return r<=n.score?n:{item:i,score:r}},{score:-1}).item}async function eu(A){const e=new AbortController,t=window.setTimeout(()=>e.abort(),400),n=pa(A);return await Xc(`${n.url}/global/health`,{headers:{Authorization:`Basic ${n.token}`},signal:e.signal}).then(i=>i.ok?A:void 0).catch(()=>{}).finally(()=>window.clearTimeout(t))}function Hk(A){return Array.isArray(A)?A.filter(e=>{if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.worktree=="string"&&typeof t.time?.updated=="number"}):[]}function Yk(A){return A.reduce((e,t)=>Math.max(e,t.time.updated),0)}async function Pk(A){if(!await eu(A))return;const t=new AbortController,n=window.setTimeout(()=>t.abort(),400),i=pa(A);return await Xc(`${i.url}/project`,{headers:{Authorization:`Basic ${i.token}`},signal:t.signal}).then(async r=>{if(!r.ok)return{url:A,count:0,time:0};const o=Hk(await r.json()).filter(Au);return{url:A,count:o.length,time:Yk(o)}}).catch(()=>({url:A,count:0,time:0})).finally(()=>window.clearTimeout(n))}function Wd(A){return Number(new URL(A).port)||0}function Zd(A){return new URL(A).hostname==="127.0.0.1"?1:0}function C1(){return window.localStorage.getItem(Zc)??""}function Fe(A){window.localStorage.setItem(Zc,A)}function qn(){window.localStorage.removeItem(Zc)}async function Vk(A){return await eu(A)!==void 0}async function jk(){const A=_k.flatMap(t=>[`http://127.0.0.1:${t}`,`http://localhost:${t}`]);return(await Promise.all(A.map(Pk))).filter(t=>t!==void 0).toSorted((t,n)=>n.count-t.count||n.time-t.time||Wd(n.url)-Wd(t.url)||Zd(n.url)-Zd(t.url))[0]?.url}async function Jn(){if(Pi.run)return await Pi.run;const A=jk().finally(()=>{Pi.run===A&&(Pi.run=void 0)});return Pi.run=A,await A}async function Mi(){const A=await Jn();if(A)return A;const e=C1();if(e){if(await Vk(e))return e;qn()}}async function zk(A){const e=JA(A),[t,n,i,r,o,s,a,l,c,g,d,Q]=await Promise.all([e.global.health(),e.config.overlay({scope:A.scope}),e.config.modelState(),e.provider.list(),e.provider.auth(),e.tui.config.get(),$1("TUI keybinds",e.tui.keybind.list()),e.tool.ids(),e.mcp.status(),e.lsp.status(),e.formatter.status(),e.app.agents()]),B=xA("Config overlay",n),C=Uk(B.effective.model),I=C?await $1("Tool metadata",e.tool.list(C)):void 0,f=xA("TUI config",s);return{health:xA("Health",t),effective:B.effective,overlay:B,sources:{sources:B.sources},modelState:xA("Model state",i),providers:xA("Providers",r),authMethods:xA("Provider auth methods",o),tui:f,keybinds:a??Ok(f),tools:xA("Tools",l),toolDetails:I??[],mcp:xA("MCP status",c),lsp:xA("LSP status",g),formatter:xA("Formatter status",d),agents:xA("Agents",Q)}}async function $k(A){return xA("Kilo embedding models",await JA(A).indexing.models())}async function tu(A){const t=await JA(A).kilo.profile(wa(A));return xA("Kilo profile",t)}async function Wk(A,e){const t=JA(A),n=await t.kilo.organization.set({...wa(A),organizationId:e});xA("Switch Kilo account",n),await t.global.dispose()}async function Zk(A){const e=JA(A),t=await e.auth.remove({providerID:"kilo"});xA("Log out of Kilo",t),await e.global.dispose()}async function Xk(A){const t=await JA(A).provider.oauth.authorize({...wa(A),providerID:"kilo",method:0});return xA("Start Kilo login",t)}async function A3(A,e){const t=JA(A),n=await t.provider.oauth.callback({...wa(A),providerID:"kilo",method:0},e?{signal:e}:void 0);xA("Complete Kilo login",n),await t.global.dispose()}async function nu(A){const e=JA(A),t=ma(A.dir),n=await e.project.list(t?{directory:t}:void 0);return xA("Projects",n)}async function ya(A){return(await nu(A)).filter(Au)}async function e3(A){const e=JA(A),[t,n]=await Promise.all([ya(A),e.experimental.session.list({archived:!1,start:Date.now()-Fk,limit:500})]),i=xA("Recent sessions",n),r=new Map;for(const o of i){const s=Jk(t,o);s&&r.set(s.id,(r.get(s.id)??0)+1)}return t.map(o=>({...o,sessions:r.get(o.id)??0})).filter(o=>o.sessions>0)}async function t3(A){const e=await Rk(A),t={url:A.url,dir:e.worktree},n=JA(t),[i,r,o]=await Promise.all([n.config.overlay({scope:"global"}),n.vcs.get({directory:t.dir}),n.worktree.list({directory:t.dir})]),s=xA("Config",i),a=xA("Worktrees",o),l=await Promise.all([t.dir,...a.map(c=>c.directory)].map(c=>o3({url:A.url},c)));return{project:e,config:s.global,vcs:xA("VCS",r),worktrees:a,terminals:l.flat()}}async function n3(A,e){const t=JA(A),n=e?.trim(),i=await t.worktree.create({directory:A.dir,...n?{worktreeCreateInput:{name:n}}:{}});return xA("Create worktree",i)}async function i3(A,e){const n=await JA(A).worktree.remove({directory:A.dir,worktreeRemoveInput:{directory:e}});return xA("Remove worktree",n)}async function r3(A,e){const n=await JA(A).worktree.reset({directory:A.dir,worktreeResetInput:{directory:e}});return xA("Reset worktree",n)}async function o3(A,e){const t=JA({url:A.url,dir:e}),[n,i,r,o]=await Promise.all([t.pty.list({directory:e}),$1("Session status",t.session.status({directory:e})),$1("Pending permissions",t.permission.list({directory:e})),$1("Pending questions",t.question.list({directory:e}))]),s=xA("Terminals",n),a=i??{},l=Xd(r??[]),c=Xd(o??[]),g=new Map;return await Promise.all(s.map(async d=>{if(!d.sessionID||g.has(d.sessionID))return;const Q=await $1("Session",t.session.get({directory:e,sessionID:d.sessionID}));Q&&g.set(d.sessionID,Q)})),s.map(d=>{const Q=d.sessionID?g.get(d.sessionID):void 0;return{...d,directory:e,session:Q,sessionStatus:d.sessionID?a[d.sessionID]:void 0,attention:d.sessionID?l3(d.sessionID,l,c):void 0}})}function iu(A){return new Set(A.flatMap(e=>e.sessionID?[e.sessionID]:[]))}function Xd(A){return new Set(A.map(e=>e.sessionID))}function AQ(A,e){return A.some(t=>e.has(t.sessionID))}async function s3(A,e){const t=JA({url:A.url,dir:e}),[n,i,r,o]=await Promise.all([$1("Session status",t.session.status({directory:e})),$1("Terminals",t.pty.list({directory:e})),$1("Pending permissions",t.permission.list({directory:e})),$1("Pending questions",t.question.list({directory:e}))]),s=iu(i??[]),a=Object.entries(n??{}).some(([c,g])=>s.has(c)&&g.type!=="idle"),l=AQ(r??[],s)||AQ(o??[],s);return{busy:a,attention:l}}async function a3(A,e){const t=JA({url:A.url,dir:e}),n=await $1("Terminals",t.pty.list({directory:e}));return iu(n??[])}function l3(A,e,t){if(e.has(A))return"permission";if(t.has(A))return"question"}async function g3(A,e){const n=await JA({url:A.url,dir:e}).worktree.diffSummary({directory:e});return xA("Worktree diff",n)}async function c3(A,e,t){const i=await JA({url:A.url,dir:e}).worktree.diffFile({directory:e,file:t});return xA("Worktree diff file",i)}async function d3(A,e,t="Kilo session"){const i=await JA({url:A.url,dir:e}).pty.create({directory:e,command:"kilo",cwd:e,title:t});return xA("Create terminal",i)}async function Q3(A,e){const n=await JA({url:A.url,dir:A.dir}).pty.remove({directory:A.dir,ptyID:e});return xA("Remove terminal",n)}async function eQ(A,e,t,n){const r=await JA(A).session.viewed({directory:A.dir,viewer:e,attached:t,visible:n});return xA("Viewed sessions",r)}function ru(A,e){const t=JA(A),n=new AbortController;return(async()=>{const i=await t.global.event({signal:n.signal,sseMaxRetryAttempts:0});for await(const r of i.stream){if(n.signal.aborted)return;e(r)}})().catch(i=>{n.signal.aborted||console.warn(`Project events: ${Ss(i)}`)}),()=>n.abort()}async function B3(A,e,t,n){const r=await JA({url:A.url,dir:A.dir}).pty.update({directory:A.dir,ptyID:e,size:{cols:t,rows:n}});return xA("Resize terminal",r)}function E3(A,e,t=0){const n=pa(A.url),i=new URL(`/pty/${encodeURIComponent(e)}/connect`,n.url);return i.protocol=i.protocol==="https:"?"wss:":"ws:",i.searchParams.set("directory",A.dir),i.searchParams.set("cursor",String(t)),i.searchParams.set("auth_token",n.token),i.toString()}async function _r(A,e,t){const n=JA(A),i=Object.keys(e).length?e:void 0,r=await n.config.overlayUpdate({directory:ma(A.dir),scope:A.scope,set:i,unset:t});return xA("Update config",r)}async function C3(A,e){return _r(A,e)}async function u3(A,e){return _r(A,{},e)}async function h3(A,e){const n=await JA(A).config.modelStateUpdate({favorite:e});return xA("Update model state",n)}async function I3(A,e,t,n){const i=JA(A),r=n?{type:"api",key:t,metadata:n}:{type:"api",key:t},o=await i.auth.set({providerID:e,auth:r});xA("Connect provider",o),await i.global.dispose()}async function f3(A,e,t,n){const r=await JA(A).provider.oauth.authorize({providerID:e,method:t,inputs:n});return xA("Authorize provider",r)}async function p3(A,e,t,n){const i=JA(A),r=await i.provider.oauth.callback({providerID:e,method:t,code:n});xA("Complete provider authorization",r),await i.global.dispose()}async function m3(A,e){const n=await JA(A).mcp.connect({name:e});return xA("Connect MCP server",n)}async function w3(A,e){const n=await JA(A).mcp.disconnect({name:e});return xA("Disconnect MCP server",n)}async function y3(A,e){const n=await JA(A).mcp.auth.authenticate({name:e});return xA("Authenticate MCP server",n)}async function D3(A,e){const n=await JA(A).tui.config.update({scope:A.scope,...e});return xA("Update TUI config",n)}async function k3(A,e){const n=await JA(A).agentBuilder.preview(e);return xA("Preview agent",n)}async function b3(A,e){const n=await JA(A).agentBuilder.save({path_id:e.id,scope:e.scope,description:e.description,mode:e.mode,model:e.model,color:e.color,steps:e.steps,tools:e.tools,permission:e.permission,prompt:e.prompt});return xA("Save agent",n)}function v3(A){return!A||A==="normal"?"default":A==="small"?"sm":A==="large"?"lg":A}function M3(A){return!A||A==="default"?"primary":A}function eA(A){const[e,t]=MA(A,["variant","size","icon","class","classList","children"]);return E(Ia,fA(t,{"data-component":"button",get"data-size"(){return v3(e.size)},get"data-variant"(){return M3(e.variant)},get"data-icon"(){return e.icon?"inline-start":void 0},get classList(){return{...e.classList,[e.class??""]:!!e.class}},get children(){return[E(H,{get when(){return e.icon},children:n=>E(Q1,{get name(){return n()},size:"small"})}),IA(()=>e.children)]}}))}function N3(A,e){const t=Object.fromEntries(Object.entries(e).filter(n=>n[1]!==void 0));if(typeof A=="string"){const n=Object.entries(t).map(i=>`${i[0]}:${i[1]}`).join(";");return n?`${A};${n}`:A}return{...A??{},...t}}var S3=k("<div>");function RA(A){const[e,t]=MA(A,["variant","size","padding","style","class","classList","children"]),n=()=>typeof e.padding=="number"?`${e.padding}px`:e.padding;return(()=>{var i=S3();return e1(i,fA(t,{"data-component":"card",get"data-variant"(){return e.variant??"normal"},get"data-size"(){return e.size??"default"},get style(){return N3(e.style,{"--kw-card-padding":n()})},get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),h(i,()=>e.children),i})()}var x3=k("<span>");function ou(A){const[e,t]=MA(A,["size","tone","class","classList","children"]);return(()=>{var n=x3();return e1(n,fA(t,{"data-component":"tag",get"data-size"(){return e.size??"normal"},get"data-tone"(){return e.tone??"neutral"},get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),h(n,()=>e.children),n})()}var L3=k("<span data-slot=status-dot aria-hidden=true>"),_3=k("<p>"),F3=k("<section data-component=section-title><div><h2>"),G3=k("<div data-component=banner role=alert><div><span>"),R3=k("<strong>"),U3=k("<span data-slot=config-row-accent>"),T3=k("<div data-slot=config-row-body><div data-slot=config-row-title>"),O3=k("<div data-slot=config-row-trailing>"),K3=k("<div data-slot=config-row-leading>"),q3=k("<div data-slot=config-row-subtitle>"),J3=k("<div data-slot=config-row-actions>"),H3=k("<a data-component=config-row>"),Y3=k("<button type=button data-component=config-row>"),P3=k("<div data-component=config-row>");function qA(A){return E(ou,fA(A,{"data-slot":"config-tag"}))}function Ee(A){return E(qA,fA(A,{tone:"neutral"}))}function su(A){return A.source==="project"||A.source==="local override"?"project":A.source==="global"||A.source==="inherited"?"global":A.overridden?"project":A.inherited?"global":"default"}function au(A){return(()=>{var e=L3();return Y(()=>V(e,"data-tone",A.tone)),e})()}function Fr(A){const e=()=>["connected","healthy","running"].includes(A.status)?{tone:"success",label:A.status==="healthy"?"Healthy":A.status==="running"?"Running":"Connected"}:["failed","error","unhealthy"].includes(A.status)?{tone:"critical",label:A.status==="unhealthy"?"Unhealthy":A.status==="failed"?"Failed":"Error"}:A.status==="stopped"?{tone:"neutral",label:"Stopped"}:{tone:"neutral",label:A.status||"Unknown"};return E(qA,{get tone(){return e().tone},class:"kw-status-tag",get children(){return[E(au,{get tone(){return IA(()=>e().tone==="critical")()?"critical":e().tone==="success"?"success":"neutral"}}),IA(()=>e().label)]}})}function lu(A){const e=()=>su(A),t=()=>e().toUpperCase();return E(qA,{class:"mono",get tone(){return e()==="project"?"info":"neutral"},get children(){return t()}})}function tt(A){return(()=>{var e=F3(),t=e.firstChild,n=t.firstChild;return h(n,()=>A.children),h(t,()=>A.trailing,null),h(e,E(H,{get when(){return A.description},children:i=>(()=>{var r=_3();return h(r,i),r})()}),null),e})()}function V3(A){const e=()=>A.tone==="critical"||A.tone==="warning"?"warning":A.tone==="success"?"circle-check":"help";return(()=>{var t=G3(),n=t.firstChild,i=n.firstChild;return h(t,E(Q1,{get name(){return e()},size:"small"}),n),h(n,E(H,{get when(){return A.title},children:r=>(()=>{var o=R3();return h(o,r),o})()}),i),h(i,()=>A.children),h(t,()=>A.action,null),Y(()=>V(t,"data-tone",A.tone??"info")),t})()}function d1(A){const e=()=>su({source:A.source})==="project"||A.highlightOverride,t=()=>[E(H,{get when(){return e()},get children(){return U3()}}),E(H,{get when(){return A.leading},children:n=>(()=>{var i=K3();return h(i,n),i})()}),(()=>{var n=T3(),i=n.firstChild;return h(i,()=>A.title),h(n,E(H,{get when(){return A.subtitle},children:r=>(()=>{var o=q3();return h(o,r),o})()}),null),n})(),(()=>{var n=O3();return h(n,E(H,{get when(){return A.source!==void 0},get children(){return E(lu,{get source(){return A.source}})}}),null),h(n,()=>A.status,null),h(n,E(H,{get when(){return A.actions},children:i=>(()=>{var r=J3();return h(r,i),r})()}),null),n})()];return A.href?(()=>{var n=H3();return h(n,t),Y(i=>{var r=e()||void 0,o=A.href;return r!==i.e&&V(n,"data-override",i.e=r),o!==i.t&&V(n,"href",i.t=o),i},{e:void 0,t:void 0}),n})():A.onClick?(()=>{var n=Y3();return zA(n,"click",A.onClick,!0),h(n,t),Y(()=>V(n,"data-override",e()||void 0)),n})():(()=>{var n=P3();return h(n,t),Y(()=>V(n,"data-override",e()||void 0)),n})()}ie(["click"]);var j3=k("<details><summary></summary><div class=models-select-menu role=listbox>"),z3=k("<button class=models-select-option type=button role=option>");function M1(A){const e=()=>A.options.find(i=>i.value===A.value)?.label??A.value;function t(i,r){A.disabled||i.disabled||(A.onSelect(i.value),r.currentTarget.closest("details")?.removeAttribute("open"))}function n(i){if(A.disabled){i.currentTarget.removeAttribute("open");return}i.currentTarget.open&&i.currentTarget.parentElement?.querySelectorAll(".models-select[open]").forEach(r=>{r!==i.currentTarget&&r.removeAttribute("open")})}return(()=>{var i=j3(),r=i.firstChild,o=r.nextSibling;return i.addEventListener("toggle",n),h(r,e),h(o,E(hA,{get each(){return A.options},children:s=>(()=>{var a=z3();return a.$$click=l=>t(s,l),h(a,()=>s.label),Y(l=>{var c=s.value===A.value,g=!!s.disabled,d=s.value===A.value,Q=A.disabled||s.disabled;return c!==l.e&&a.classList.toggle("selected",l.e=c),g!==l.t&&a.classList.toggle("disabled",l.t=g),d!==l.a&&V(a,"aria-selected",l.a=d),Q!==l.o&&(a.disabled=l.o=Q),l},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()})),Y(s=>{var a=`models-select ${A.class??""}`,l=!!A.disabled,c=!!A.invalid,g=A.label,d=A.disabled,Q=A.label;return a!==s.e&&xn(i,s.e=a),l!==s.t&&i.classList.toggle("disabled",s.t=l),c!==s.a&&i.classList.toggle("invalid",s.a=c),g!==s.o&&V(r,"aria-label",s.o=g),d!==s.i&&V(r,"aria-disabled",s.i=d),Q!==s.n&&V(o,"aria-label",s.n=Q),s},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()}ie(["click"]);var $3=k("<label data-component=search-field><span data-slot=search-label></span><input>");function L1(A){const[e,t]=MA(A,["label","value","variant","hideLabel","inputClass","class","classList","onValue"]);return(()=>{var n=$3(),i=n.firstChild,r=i.nextSibling;return h(i,()=>e.label),e1(r,fA(t,{get class(){return e.inputClass},type:"search",get value(){return e.value},get"aria-label"(){return IA(()=>e.hideLabel===!1)()?void 0:e.label},onInput:o=>e.onValue(o.currentTarget.value)}),!1,!1),Y(o=>{var s=e.variant??"list",a=e.hideLabel===!1?"visible":"hidden",l={...e.classList,[e.class??""]:!!e.class};return s!==o.e&&V(n,"data-variant",o.e=s),a!==o.t&&V(n,"data-label",o.t=a),o.a=vi(n,l,o.a),o},{e:void 0,t:void 0,a:void 0}),n})()}const gu=A1();function xe(){const A=Pe(gu);if(!A)throw new Error("useConfig must be used within ConfigLayout");return A}function A0(){return"/console/".replace(/\/$/,"")}function lo(A,e=A0()){return!e||e==="/"?A:A===e?"/":A.startsWith(`${e}/`)?A.slice(e.length):A}function cu(A,e=A0()){const t=lo(A,e),n=t.indexOf("/settings");return n>0?`${t.slice(0,n)}/settings`:t.startsWith("/config")?"/config":"/settings"}function W3(A,e=A0()){const t=lo(A,e);return t==="/profile"||t.startsWith("/kilo/login")?"/profile":t.startsWith("/settings")||t.startsWith("/config")?"/settings":t.startsWith("/projects/")?"/project":"/projects"}const Z3={apply_patch:"Apply Patch",bash:"Bash",edit:"Edit File",glob:"Find Files",grep:"Search Content",lsp:"Language Server",question:"Ask User",read:"Read File",recall:"Local Recall",skill:"Load Skill",task:"Subagent Task",todowrite:"Todo List",webfetch:"Fetch URL",websearch:"Web Search",write:"Write File"},X3={apply_patch:["Apply structured patches to add, update, move, or delete files.","Keeps edits explicit and easy to review."],bash:["Run shell commands in the current workspace.","Supports timeouts, working directories, and command descriptions."],edit:["Replace exact text inside an existing file.","Can update one match or all matches when needed."],glob:["Find files by path patterns.","Useful for locating files before reading or editing them."],grep:["Search file contents with regular expressions.","Can limit results to a file pattern such as TypeScript or CSS files."],lsp:["Use language-server features for code navigation.","Supports operations such as definitions, references, and diagnostics."],question:["Ask the user for a decision during execution.","Supports single-choice and multi-choice prompts."],read:["Read files, directories, images, and PDFs from the workspace.","Supports line offsets and limits for large files."],recall:["Search and read previous project conversations.","Useful for recovering prior decisions or implementation context."],skill:["Load task-specific instructions and workflows.","Applies specialized repo guidance when a matching skill exists."],task:["Delegate focused exploration or implementation work to a subagent.","Useful for parallel codebase research and complex subtasks."],todowrite:["Track multi-step implementation work.","Shows progress with pending, in-progress, and completed states."],webfetch:["Fetch and convert web pages for analysis.","Supports markdown, text, and HTML output formats."],websearch:["Search the web for external information.","Supports fast, automatic, and deep search modes."],write:["Create or overwrite files with complete contents.","Best for new files or full-file replacements."]},A8=new Set(["api","html","id","json","lsp","mcp","pdf","url"]);function LA(A){return A.trim()}function wn(A){return A==null||A===""?"Not set":typeof A=="string"?A:typeof A=="number"||typeof A=="boolean"?String(A):JSON.stringify(A)??"Unserializable value"}function du(A){return[...A].sort((e,t)=>e.localeCompare(t))}function Rg(A){return A.split(/\s+/).map(e=>e.trim()).filter(Boolean)}function E1(A){return A.trim().split(/[\s._/-]+/).filter(Boolean).map(e=>/^[A-Z0-9]+$/.test(e)&&e.length<=4?e:`${e[0]?.toUpperCase()??""}${e.slice(1).toLowerCase()}`).join(" ")}function e8(A){const e=A.toLowerCase();return A8.has(e)?e.toUpperCase():A.charAt(0).toUpperCase()+A.slice(1)}function tQ(A){return A.length<=180?A:`${A.slice(0,177)}...`}function t8(A){const e=A.replace(/```[\s\S]*?```/g," ").replace(/[*`#>_-]+/g," ").replace(/\s+/g," ").trim(),t=e.split(/(?:\.|\?|!)\s+/).map(n=>n.trim()).filter(Boolean).slice(0,2);return t.length?t.map(tQ):e?[tQ(e)]:[]}function Et(A){const e=Z3[A];if(e)return e;const t=A.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[._:/-]+/g," ").replace(/\s+/g," ").trim();return t?t.split(" ").map(e8).join(" "):A}function e0(A){const e=X3[A.id];if(e)return e;const t=A.detail?.description.trim();return t?t8(t):["No capability description is available for this tool."]}function hi(A){return A.split(",").map(e=>e.trim()).filter(Boolean)}function nQ(A){return!A||typeof A!="object"||Array.isArray(A)?0:Object.keys(A).length}function Qe(A){return A instanceof Error?A.message:typeof A=="string"?A:wn(A)}function n8(A){return A==="subagent"?"subagent":A==="all"?"all":"primary"}var i8=k("<main class=config-page><section class=config-page-header><div><h1>"),r8=k("<p>"),o8=k("<div class=config-page-actions>"),s8=k("<section class=config-toolbar>"),a8=k("<div class=config-toolbar-controls>"),l8=k("<div class=config-toolbar-meta>");function Le(A){return(()=>{var e=i8(),t=e.firstChild,n=t.firstChild,i=n.firstChild;return h(i,()=>A.title),h(n,E(H,{get when(){return A.description},children:r=>(()=>{var o=r8();return h(o,r),o})()}),null),h(t,E(H,{get when(){return A.actions},children:r=>(()=>{var o=o8();return h(o,r),o})()}),null),h(e,()=>A.children,null),e})()}function Qu(A){return E(H,{get when(){return A.children||A.meta},get children(){var e=s8();return h(e,E(H,{get when(){return A.children},children:t=>(()=>{var n=a8();return h(n,t),n})()}),null),h(e,E(H,{get when(){return A.meta},children:t=>(()=>{var n=l8();return h(n,t),n})()}),null),e}})}function de(A){return E(lu,A)}const Bu=[{value:"ask",label:"Ask"},{value:"allow",label:"Allow"},{value:"deny",label:"Deny"}],Tt=[{id:"external_directory",title:"External Directory",description:"Access files outside the project directory.",noun:"path",placeholder:"e.g. ~/Downloads/**"},{id:"bash",title:"Bash",description:"Run shell commands.",noun:"command",placeholder:"e.g. git status or npm *"},{id:"read",title:"Read",description:"Read files by matching file paths.",noun:"path",placeholder:"e.g. **/*.env"},{id:"edit",title:"Edit",description:"Modify files, including writes, patches, and multi-edits.",noun:"path",placeholder:"e.g. src/**/*.ts"}],t0=[{id:"glob",title:"Glob",description:"Match files using glob patterns."},{id:"grep",title:"Grep",description:"Search file contents using regular expressions."},{id:"list",title:"List",description:"List files within a directory."},{id:"task",title:"Task",description:"Launch sub-agents."},{id:"skill",title:"Skill",description:"Load a skill by name."},{id:"lsp",title:"LSP",description:"Run language server queries."},{id:"todowrite",title:"Todo Write",description:"Update the todo list."},{id:"question",title:"Question",description:"Ask the user a question."},{id:"webfetch",title:"Web Fetch",description:"Fetch content from a URL."},{id:"websearch",title:"Web Search",description:"Search the web."},{id:"doom_loop",title:"Doom Loop",description:"Detect repeated tool calls with identical input."},{id:"agent_manager",title:"Agent Manager",description:"Manage Agent Manager operations."}],Eu=[...Tt,...t0],g8=new Set(Tt.map(A=>A.id)),c8=new Set(Eu.map(A=>A.id));function n0(A,e="ask"){return A==="ask"||A==="allow"||A==="deny"?A:e}function Da(A){return A&&typeof A=="object"&&!Array.isArray(A)?A:{}}function Cu(A){return Da(A.effective.permission)}function i0(A,e){return A.overlay.collections.permission?.find(t=>t.key===e)}function uu(A,e){return typeof A.effective.permission=="string"?A.effective.permission:Cu(A)[e]}function hu(A){return n0(A.effective.permission)}function d8(A,e){return A?e==="*"&&typeof A.value=="string"?A.path:[...A.path,e]:["permission",e]}function Gr(A,e,t,n){if(!(t!=="ask"&&t!=="allow"&&t!=="deny"))return{tool:A,pattern:e,action:t,source:n?.source??"default",inherited:n?.inherited??!1,overridden:n?.overridden??!1,path:n?d8(n,e):["permission",A,e]}}function Q8(A){const e=A.value;if(e&&typeof e=="object"&&!Array.isArray(e))return Object.entries(e).flatMap(([n,i])=>Gr(A.key,n,i,A)??[]);const t=Gr(A.key,"*",e,A);return t?[t]:[]}function B8(A,e,t){const n=Da(e);if(Object.keys(n).length)return Object.entries(n).flatMap(([r,o])=>Gr(A,r,o,t)??[]);const i=Gr(A,"*",e,t);return i?[i]:[]}function E8(A,e){const t=i0(A,e.id),n=uu(A,e.id),i=Da(n),r=hu(A);return{...e,action:n0(typeof n=="string"?n:i["*"],r),source:t?.source??"default",inherited:t?.inherited??!1,overridden:t?.overridden??!1}}function C8(A,e){const t=i0(A,e.id),n=uu(A,e.id),i=Da(n),r=hu(A);return{...e,action:n0(typeof n=="string"?n:i["*"],r),source:t?.source??"default",inherited:t?.inherited??!1,overridden:t?.overridden??!1,rules:Object.entries(i).filter(([o])=>o!=="*").flatMap(([o,s])=>Gr(e.id,o,s,t)??[])}}function u8(){const A=xe(),e=()=>A.data(),[t,n]=T("closed"),[i,r]=T("external_directory"),[o,s]=T(""),[a,l]=T("ask"),c=R(()=>(e()?.overlay.collections.permission??[]).flatMap(Q8)),g=R(()=>{const w=e();return w?Tt.map(m=>C8(w,m)):[]}),d=R(()=>{const w=e();return w?t0.map(m=>E8(w,m)):[]}),Q=R(()=>{const w=e();return w?Object.entries(Cu(w)).filter(([m])=>!c8.has(m)).flatMap(([m,y])=>B8(m,y,i0(w,m))).sort((m,y)=>m.tool.localeCompare(y.tool)||m.pattern.localeCompare(y.pattern)):[]}),B=R(()=>Tt.find(w=>w.id===i())??Tt[0]);function C(w){r(w),s(""),l("ask"),n("rule")}function I(){n("closed")}function f(){const w=e(),m=LA(o());if(!w||!m){A.fail(`Enter a ${B().noun} pattern before saving.`);return}const y={[i()]:{[m]:a()}};A.save({permission:y}),I()}function u(w,m){const y=g8.has(w)?{[w]:{"*":m}}:{[w]:m};A.save({permission:y})}function p(w){A.unset([w.path])}return{ctx:A,mode:t,kind:i,pattern:o,setPattern:s,action:a,setAction:l,rules:c,groups:g,settings:d,other:Q,selected:B,open:C,close:I,add:f,setDefault:u,remove:p}}var Ug=k("<div class=permission-row-meta>"),h8=k('<details class="models-select permission-select"><summary></summary><div class=models-select-menu role=listbox>'),I8=k("<button class=models-select-option type=button role=option>"),f8=k("<section class=permission-group><div class=permission-rules>"),p8=k("<div class=permissions><section class=permission-group><div class=permission-rules>"),m8=k("<div class=drawer-scrim>"),w8=k('<aside class="provider-drawer permission-drawer"aria-label="Permission rule configuration"><header class=drawer-header><div><h2></h2><span></span></div></header><div class="provider-form permission-form"><label class="required-field wide"><input></label><label class="required-field wide">Method</label></div><footer class=drawer-footer>'),y8=k("<span class=config-title-count>Permissions"),D8=k("<section class=permission-group><header class=permission-group-header><div class=permission-group-copy><h2></h2><span></span><p></p></div><div class=permission-section-actions></div></header><div class=permission-rules>"),k8=k("<p class=permission-empty>No specific <!> rules."),b8=k("<span class=permission-pattern>"),v8=k("<span class=permission-subtitle><span></span><span class=permission-pattern>");function Iu(A){return A==="allow"?"success":A==="deny"?"critical":"warning"}function r0(A){return Bu.find(e=>e.value===A)?.label??A}function iQ(A){return(()=>{var e=Ug();return h(e,E(qA,{get tone(){return Iu(A.rule.action)},get children(){return r0(A.rule.action)}}),null),h(e,E(de,{get source(){return A.rule.source},get inherited(){return A.rule.inherited},get overridden(){return A.rule.overridden}}),null),e})()}function Ii(A){const e=()=>r0(A.value);function t(i,r){A.disabled||(A.onSelect(i),r.currentTarget.closest("details")?.removeAttribute("open"))}function n(i){if(A.disabled){i.currentTarget.removeAttribute("open");return}i.currentTarget.open&&i.currentTarget.parentElement?.querySelectorAll(".models-select[open]").forEach(r=>{r!==i.currentTarget&&r.removeAttribute("open")})}return(()=>{var i=h8(),r=i.firstChild,o=r.nextSibling;return i.addEventListener("toggle",n),h(r,e),h(o,E(hA,{each:Bu,children:s=>(()=>{var a=I8();return a.$$click=l=>t(s.value,l),h(a,()=>s.label),Y(l=>{var c=s.value===A.value,g=s.value===A.value;return c!==l.e&&a.classList.toggle("selected",l.e=c),g!==l.t&&V(a,"aria-selected",l.t=g),l},{e:void 0,t:void 0}),a})()})),Y(s=>{var a=!!A.disabled,l=A.label,c=A.disabled,g=A.label;return a!==s.e&&i.classList.toggle("disabled",s.e=a),l!==s.t&&V(r,"aria-label",s.t=l),c!==s.a&&V(r,"aria-disabled",s.a=c),g!==s.o&&V(o,"aria-label",s.o=g),s},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()}function M8(){const A=u8();return E(Le,{get title(){return(()=>{var e=y8();return e.firstChild,h(e,E(Ee,{get children(){return A.groups().length+A.settings().length}}),null),e})()},description:"Control what tools agents can use by default and add pattern-specific allow, ask, or deny rules.",get children(){return[(()=>{var e=p8(),t=e.firstChild,n=t.firstChild;return h(e,E(hA,{get each(){return A.groups()},children:i=>(()=>{var r=D8(),o=r.firstChild,s=o.firstChild,a=s.firstChild,l=a.nextSibling,c=l.nextSibling,g=s.nextSibling,d=o.nextSibling;return h(a,()=>i.title),h(l,()=>i.id),h(c,()=>i.description),h(g,E(Ee,{get children(){return i.rules.length}}),null),h(g,E(eA,{icon:"plus",variant:"primary",get disabled(){return!!A.ctx.saving()},onClick:()=>A.open(i.id),children:"Add rule"}),null),h(r,E(d1,{title:"Default method",get subtitle(){return`Used for ${i.noun}s that do not match a specific rule.`},get status(){return(()=>{var Q=Ug();return h(Q,E(de,{get source(){return i.source},get inherited(){return i.inherited},get overridden(){return i.overridden}})),Q})()},get actions(){return E(Ii,{get label(){return`Default method for ${i.title}`},get value(){return i.action},get disabled(){return!!A.ctx.saving()},onSelect:Q=>A.setDefault(i.id,Q)})}}),d),h(d,E(H,{get when(){return i.rules.length},get fallback(){return(()=>{var Q=k8(),B=Q.firstChild,C=B.nextSibling;return C.nextSibling,h(Q,()=>i.noun,C),Q})()},get children(){return E(hA,{get each(){return i.rules},children:Q=>E(d1,{get title(){return(()=>{var B=b8();return h(B,()=>Q.pattern),B})()},get subtitle(){return`${i.title} ${i.noun} rule`},get status(){return E(iQ,{rule:Q})},get actions(){return E(ke,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${i.title} rule ${Q.pattern}`},get disabled(){return!!A.ctx.saving()},onClick:()=>A.remove(Q)})}})})}})),r})()}),t),h(t,E(tt,{get trailing(){return E(Ee,{get children(){return A.settings().length}})},description:"Default methods for additional built-in tool permissions.",children:"Tool Defaults"}),n),h(n,E(hA,{get each(){return A.settings()},children:i=>E(d1,{get title(){return i.title},get subtitle(){return`${i.id} · ${i.description}`},get status(){return(()=>{var r=Ug();return h(r,E(de,{get source(){return i.source},get inherited(){return i.inherited},get overridden(){return i.overridden}})),r})()},get actions(){return E(Ii,{get label(){return`Default method for ${i.title}`},get value(){return i.action},get disabled(){return!!A.ctx.saving()},onSelect:r=>A.setDefault(i.id,r)})}})})),h(e,E(H,{get when(){return A.other().length},get children(){var i=f8(),r=i.firstChild;return h(i,E(tt,{get trailing(){return E(Ee,{get children(){return A.other().length}})},description:"Additional tool permission rules from config.",children:"Other Permissions"}),r),h(r,E(hA,{get each(){return A.other()},children:o=>E(d1,{get title(){return Et(o.tool)},get subtitle(){return(()=>{var s=v8(),a=s.firstChild,l=a.nextSibling;return h(a,()=>o.tool),h(l,()=>o.pattern),s})()},get status(){return E(iQ,{rule:o})},get actions(){return E(ke,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${o.tool} rule ${o.pattern}`},get disabled(){return!!A.ctx.saving()},onClick:()=>A.remove(o)})}})})),i}}),null),e})(),E(H,{get when(){return A.mode()==="rule"},get children(){return[(()=>{var e=m8();return zA(e,"click",A.close,!0),e})(),(()=>{var e=w8(),t=e.firstChild,n=t.firstChild,i=n.firstChild,r=i.nextSibling,o=t.nextSibling,s=o.firstChild,a=s.firstChild,l=s.nextSibling;l.firstChild;var c=o.nextSibling;return h(i,()=>`Add ${A.selected().title} Rule`),h(r,()=>`${A.selected().id} · ${A.selected().description}`),h(t,E(eA,{variant:"ghost","aria-label":"Close permission rule overlay",get onClick(){return A.close},children:"X"}),null),h(s,()=>A.selected().noun==="command"?"Command pattern":"Path pattern",a),a.$$input=g=>A.setPattern(g.currentTarget.value),V(a,"spellcheck",!1),h(l,E(Ii,{label:"Rule method",get value(){return A.action()},get disabled(){return!!A.ctx.saving()},get onSelect(){return A.setAction}}),null),h(c,E(eA,{variant:"ghost",get onClick(){return A.close},children:"Cancel"}),null),h(c,E(eA,{variant:"primary",get disabled(){return!!A.ctx.saving()},get onClick(){return A.add},children:"Save Rule"}),null),Y(()=>V(a,"placeholder",A.selected().placeholder)),Y(()=>a.value=A.pattern()),e})()]}})]}})}ie(["click","input"]);const N8=["Review the current diff and report risks, regressions, and missing tests.","Plan the work in small steps, then implement the smallest correct change.","Inspect relevant files first, then summarize the root cause before editing.","Run the smallest relevant validation checks and report any remaining failures."];function S8(A,e){return A.id==="kilo"?-1:e.id==="kilo"?1:A.name.localeCompare(e.name)}function x8(A,e){return A.provider.id===e.providerID&&A.model.id===e.modelID?!0:A.model.providerID===e.providerID&&A.model.id===e.modelID}function hl(A){const e=LA(A);if(e)return e}function L8(A){const e=Number(A);if(Number.isInteger(e)&&e>0)return e}function xt(A){return A&&typeof A=="object"&&!Array.isArray(A)?A:{}}function Xt(A){return typeof A=="string"?A:""}function _8(A){if(typeof A=="number"&&Number.isFinite(A))return A}function rQ(A,e="ask"){return A==="allow"||A==="deny"||A==="ask"?A:e}function Tg(A,e,t){if(!(t!=="allow"&&t!=="deny"&&t!=="ask"))return{tool:A,pattern:e,action:t}}function oQ(A,e){const t=xt(e);if(Object.keys(t).length)return Object.entries(t).flatMap(([i,r])=>Tg(A,i,r)??[]);const n=Tg(A,"*",e);return n?[n]:[]}const F8=new Set(Tt.map(A=>A.id)),G8=new Set(Eu.map(A=>A.id));function R8(A){const e=A.options.source;if(typeof e=="string")return e}function U8(A){const e=Object.entries(T8(A));return{tools:du(e.filter(([,t])=>t==="allow").map(([t])=>t)),permission:Object.fromEntries(e.filter(([,t])=>t!=="allow"))}}function T8(A){return Array.isArray(A)?A.reduce((e,t)=>{const n=xt(t),i=Xt(n.permission),r=Xt(n.action);if(!i||!r)return e;const o=Xt(n.pattern)||"*";if(o==="*")return{...e,[i]:r};const s=e[i],a=s&&typeof s=="object"&&!Array.isArray(s)?s:{};return{...e,[i]:{...a,[o]:r}}},{}):xt(A)}function O8(A,e){return(A.overlay.collections.agent??[]).find(t=>t.key===e)}function Vi(A){return A.displayName??E1(A.name)}function K8(A){return A.model?`${A.model.providerID}/${A.model.modelID}`:""}function Og(A,e){return!(A.native||e?.inherited||e?.editable===!1||R8(A)==="organization")}function q8(A){const e=xe(),t=()=>e.data(),n=R(()=>e.query()?.scope??"project"),[i,r]=T(),[o,s]=T(!0),[a,l]=T(!1),[c,g]=T("reviewer"),[d,Q]=T(""),[B,C]=T("subagent"),[I,f]=T(""),[u,p]=T(""),[w,m]=T(""),[y,M]=T([]),[v,N]=T(""),[_,F]=T("external_directory"),[x,S]=T(""),[G,K]=T("ask"),[q,J]=T({}),[P,j]=T(),[oA,aA]=T("closed"),[z,dA]=T(""),[sA,lA]=T(""),[EA,CA]=T(""),[UA,kA]=T([]),bA=R(()=>{const $=t();if(!$)return[];const tA=new Set([...Object.keys($.effective.provider??{}),...$.providers.connected]);return $.providers.all.filter(BA=>tA.has(BA.id)).filter(BA=>Object.keys(BA.models).length>0).sort(S8)}),PA=R(()=>bA().flatMap($=>Object.values($.models).map(tA=>({id:`${$.id}/${tA.id}`,provider:$,model:tA})))),re=R(()=>t()?.modelState.favorite??[]),Z=$=>re().some(tA=>x8($,tA)),D=R(()=>{const $=z().trim().toLowerCase();return PA().filter(tA=>$?`${tA.id} ${tA.model.name} ${tA.provider.name}`.toLowerCase().includes($):!0).sort((tA,BA)=>{const GA=Number(Z(BA))-Number(Z(tA));if(GA!==0)return GA;const XA=tA.model.name.localeCompare(BA.model.name);if(XA!==0)return XA;const HA=tA.provider.name.localeCompare(BA.provider.name);return HA!==0?HA:tA.id.localeCompare(BA.id)})}),uA=$=>{if(typeof $=="string")return PA().find(tA=>tA.id===$||`${tA.model.providerID}/${tA.model.id}`===$)},pA=R(()=>uA(I())),VA=R(()=>{const $=t();if(!$)return[];const tA=EA().trim().toLowerCase(),BA=new Map($.toolDetails.map(GA=>[GA.id,GA]));return $.tools.map(GA=>({id:GA,detail:BA.get(GA)})).filter(GA=>tA?`${GA.id} ${Et(GA.id)} ${e0(GA).join(" ")}`.toLowerCase().includes(tA):!0).sort((GA,XA)=>Et(GA.id).localeCompare(Et(XA.id)))}),ge=R(()=>new Set(UA())),u1=R(()=>Object.entries(q()).flatMap(([$,tA])=>oQ($,tA))),G1=R(()=>Tt.map($=>{const tA=q()[$.id],BA=xt(tA);return{...$,action:rQ(typeof tA=="string"?tA:BA["*"]),rules:Object.entries(BA).filter(([GA])=>GA!=="*").flatMap(([GA,XA])=>Tg($.id,GA,XA)??[])}})),wt=R(()=>t0.map($=>{const tA=q()[$.id],BA=xt(tA);return{...$,action:rQ(typeof tA=="string"?tA:BA["*"])}})),yt=R(()=>Object.entries(q()).filter(([$])=>!G8.has($)).flatMap(([$,tA])=>oQ($,tA)).sort(($,tA)=>$.tool.localeCompare(tA.tool)||$.pattern.localeCompare(tA.pattern))),Ve=R(()=>Tt.find($=>$.id===_())??Tt[0]);function R1($="reviewer"){g($),Q(""),C("subagent"),f(""),p(""),m(""),M([]),N(""),J({}),j(void 0),l(!1),aA("closed"),F("external_directory"),S(""),K("ask"),dA(""),lA(""),CA(""),kA([])}iA(()=>{A?.()||i()!==""&&(R1(),s(!0),r(""))}),iA(()=>{const $=t(),tA=A?.();if(!$||!tA||i()===tA)return;R1(tA),s(!1),r(tA);const BA=$.agents.find(i1=>i1.name===tA);if(!BA){e.fail(`Agent not found: ${tA}`);return}const GA=O8($,tA),XA=Og(BA,GA);e.fail(""),s(!0),l(!XA);const HA=xt(GA?.value),h1=U8(HA.permission??(XA?void 0:BA.permission)),I1=_8(HA.steps)??BA.steps;g(BA.name),Q(Xt(HA.description)||BA.description||""),C(n8(Xt(HA.mode)||BA.mode)),f(Xt(HA.model)||K8(BA)),p(Xt(HA.color)||BA.color||""),m(I1?String(I1):""),M(h1.tools),J(h1.permission),N(Xt(HA.prompt)||BA.prompt||"")});function Ie(){aA("closed")}function fe(){return a()?(e.fail("Inspected agents are read-only."),!1):!0}function U1(){const $=n1();$&&(j(void 0),aA("markdown"),e.run("Previewing agent",()=>k3(e.target(),$).then(j),{refetch:!1}))}function Ht(){fe()&&(dA(""),lA(I()),aA("model"))}function T1($){lA($.id)}function ot(){if(!fe())return;const $=sA();if(!$){e.fail("Select a model before saving the agent model field.");return}f($),Ie()}function O1(){fe()&&f("")}function Yt(){fe()&&(CA(""),kA(y()),aA("tools"))}function cA($){if(!fe())return;const tA=new Set(UA());tA.has($)?tA.delete($):tA.add($),kA(du(tA))}function wA(){fe()&&(M(UA()),Ie())}function jA(){fe()&&M([])}function ve($){fe()&&(F($),S(""),K("ask"),aA("permission"))}function je($,tA){if(!fe())return;const BA={...q()};if(!F8.has($)){BA[$]=tA,J(BA);return}const GA=xt(BA[$]);BA[$]={...GA,"*":tA},J(BA)}function ee(){if(!fe())return;const $=LA(x());if(!$){e.fail(`Enter a ${Ve().noun} pattern before saving.`);return}const tA=_(),BA={...q()},GA=BA[tA],XA=GA&&typeof GA=="object"&&!Array.isArray(GA)?{...GA}:{};XA[$]=G(),BA[tA]=XA,J(BA),Ie()}function we($){if(!fe())return;const tA={...q()};if($.pattern==="*"){const GA={...xt(tA[$.tool])};if(Object.keys(GA).length){delete GA["*"],Object.keys(GA).length?tA[$.tool]=GA:delete tA[$.tool],J(tA);return}delete tA[$.tool],J(tA);return}const BA={...xt(tA[$.tool])};delete BA[$.pattern],Object.keys(BA).length?tA[$.tool]=BA:delete tA[$.tool],J(tA)}function ze($){if(!fe())return;const tA=LA(v());N(tA?`${tA}
|
|
21
21
|
|
|
22
22
|
${$}`:$)}function n1(){if(!o()){e.fail("Select an agent before previewing or saving.");return}const $=LA(c()),tA=LA(v());if(!$||!tA){e.fail("Enter an agent id and prompt before previewing or saving.");return}const BA=q();return{scope:n(),id:$,description:hl(d()),mode:B(),model:hl(I()),color:hl(u()),steps:L8(w()),tools:y().length?y():void 0,permission:Object.keys(BA).length?BA:void 0,prompt:tA}}function gA(){if(!fe())return;const $=n1();$&&e.run("Saving agent",()=>b3(e.target(),$).then(j))}return{ctx:e,snap:t,scope:n,id:c,setId:g,desc:d,setDesc:Q,mode:B,setMode:C,model:I,setModel:f,color:u,setColor:p,steps:w,setSteps:m,tools:y,prompt:v,setPrompt:N,permTool:_,setPermTool:F,permPattern:x,setPermPattern:S,permAction:G,setPermAction:K,permissionGroups:G1,permissionDefaults:wt,permissionOther:yt,selectedPermission:Ve,draft:P,ready:o,locked:a,panel:oA,close:Ie,openMarkdown:U1,picker:z,setPicker:dA,choice:sA,models:D,selected:pA,fav:Z,openModel:Ht,selectModel:T1,saveModel:ot,clearModel:O1,search:EA,setSearch:CA,options:VA,pickedDraft:ge,openTools:Yt,rules:u1,openPermission:ve,setPermissionDefault:je,removePermission:we,toggleTool:cA,saveTools:wA,clearTools:jA,addPermission:ee,insert:ze,save:gA}}var J8=k("<div class=agent-builder-field-actions>"),H8=k('<div class="ui-field agent-builder-field"><div class=agent-builder-field-head><div><span></span></div></div><div class=agent-builder-control>'),Y8=k("<small>"),P8=k("<div class=permission-row-meta>"),V8=k("<div class=agents>"),j8=k("<span class=config-title-count>Agents"),z8=k("<p class=empty>"),$8=k("<section class=agent-section>"),W8=k("<div>"),Z8=k("<span class=agent-mode-dot aria-hidden=true>"),X8=k("<span class=agent-subtitle><span class=agent-id></span><span class=agent-description>"),Ab=k('<div class="tags agent-tags">'),eb=k("<header class=ui-card-header><div><h2>Identity</h2><p>Name, mode, and display metadata for this agent."),tb=k("<input class=mono placeholder=reviewer>"),nb=k('<input placeholder="Review code and report risks">'),ib=k('<div class=agent-color-control><input class=mono placeholder=#0e639c><div class=agent-color-swatches aria-label="Preset colors">'),rb=k("<input class=mono placeholder=optional inputmode=numeric>"),sQ=k('<div class="ui-form agent-builder-form">'),ob=k("<header class=ui-card-header><div><h2>Model And Tools</h2><p>Choose the model and default tool access written into the agent frontmatter."),Il=k("<strong>"),sb=k('<div class="tag-cloud agent-tool-summary">'),ab=k("<header class=ui-card-header><div><h2>System Prompt</h2><p>Markdown instructions that define how this agent behaves."),lb=k('<textarea class="mono agent-prompt-input"placeholder="Describe how this agent should behave.">'),gb=k('<div class="ui-form agent-builder-form"><div class=agent-snippets><div class=block-title><strong>Prompt snippets</strong><span>Insert a starter instruction into the prompt, then customize it.</span></div><div class=snippet-list>'),cb=k("<header class=ui-card-header><div><h2>Agent Permissions</h2><p>Add scalar or pattern-specific overrides before previewing markdown."),db=k("<section class=permission-group><div class=permission-rules>"),Qb=k('<div class="ui-card-body agent-permissions-body"><div class="permissions agent-permissions"><section class=permission-group><div class=permission-rules>'),Bb=k('<div class="builder agent-builder"><section class="builder-form agent-builder-stack">'),ko=k("<div class=drawer-scrim>"),Eb=k('<aside class=provider-drawer aria-label="Agent model selector"><header class=drawer-header><div><h2>Choose Model</h2><span>Favorites are listed first, then models are sorted alphabetically.</span></div></header><div class="provider-picker model-picker"></div><footer class=drawer-footer>'),Cb=k('<aside class=provider-drawer aria-label="Agent tool access selector"><header class=drawer-header><div><h2>Choose Tool Access</h2><span>Selected tools are written as allow permissions in the agent frontmatter.</span></div></header><div class="provider-picker tool-picker"></div><footer class=drawer-footer>'),ub=k('<aside class="provider-drawer permission-drawer"aria-label="Agent permission rule configuration"><header class=drawer-header><div><h2></h2><span></span></div></header><div class="provider-form permission-form"><label class="required-field wide"><input></label><label class="required-field wide">Method</label></div><footer class=drawer-footer>'),hb=k('<aside class=provider-drawer aria-label="Generated agent markdown"><header class=drawer-header><div><h2>Markdown</h2><span></span></div></header><div class="provider-picker markdown-picker">'),Ib=k("<button class=agent-color-swatch type=button>"),aQ=k("<span class=mono>"),fb=k("<strong>No tools selected"),pb=k("<span>No allow permissions will be written."),mb=k("<section class=permission-group><header class=permission-group-header><div class=permission-group-copy><h2></h2><span></span><p></p></div><div class=permission-section-actions></div></header><div class=permission-rules>"),wb=k("<p class=permission-empty>No specific <!> rules."),yb=k("<span class=permission-pattern>"),Db=k("<span class=permission-subtitle><span></span><span class=permission-pattern>"),kb=k("<p class=empty>No models match this filter."),bb=k('<button class="provider-option model-option"type=button><span class=model-star aria-hidden=true></span><div><strong></strong><span></span></div><div class=tags>'),vb=k("<p class=empty>No tools match this filter."),Mb=k('<button class="provider-option tool-option"type=button><div class="model-main tool-main"><div class=model-title><div><strong></strong><span></span></div></div><div class=tags></div></div><ul class=tool-capabilities>'),Nb=k("<li>"),Sb=k("<p class=empty>Generating markdown preview..."),xb=k("<pre class=markdown-preview>");const Lb=["#0e639c","#89d185","#cca700","#f14c4c","#3794ff","#c586c0","#9cdcfe"],_b=[{value:"primary",label:"Primary"},{value:"subagent",label:"Subagent"},{value:"all",label:"Both"}];function lQ(A){return A.description??"No description available."}function Fb(A){return A===0?"Project Agents":"Global Agents"}function fu(){const A=mt(),e=Ca();return{href:n=>{const i=n?`/${encodeURIComponent(n)}`:"";return`${cu(A.pathname)}/agents${i}${A.search}`},nav:e}}function Gb(A){return A.length===1?"1 tool":`${A.length} tools`}function Vt(A){return(()=>{var e=H8(),t=e.firstChild,n=t.firstChild,i=n.firstChild,r=t.nextSibling;return h(i,()=>A.label),h(n,E(H,{get when(){return A.description},children:o=>(()=>{var s=Y8();return h(s,o),s})()}),null),h(t,E(H,{get when(){return A.actions},get children(){var o=J8();return h(o,()=>A.actions),o}}),null),h(r,()=>A.children),e})()}function gQ(A){return(()=>{var e=P8();return h(e,E(qA,{get tone(){return Iu(A.action)},get children(){return r0(A.action)}})),e})()}function Rb(){const A=fu(),e=xe(),[t,n]=T(""),i=()=>e.data(),r=R(()=>{const l=i();if(!l)return[];const c=e.query()?.scope??"global",g=new Map((l.overlay.collections.agent??[]).map(Q=>[Q.key,Q])),d=new Set((l.overlay.collections.agent??[]).filter(Q=>Q.source==="project").map(Q=>Q.key));return l.agents.filter(Q=>{const B=g.get(Q.name);return c==="global"?!B?.local:d.has(Q.name)||!B?.local}).map(Q=>({item:Q,entry:g.get(Q.name),rank:d.has(Q.name)?0:1})).sort((Q,B)=>Q.rank-B.rank||Vi(Q.item).localeCompare(Vi(B.item)))}),o=R(()=>{const l=t().trim().toLowerCase();return l?r().filter(c=>`${Vi(c.item)} ${c.item.name} ${lQ(c.item)}`.toLowerCase().includes(l)):r()}),s=R(()=>[0,1].map(l=>o().filter(c=>c.rank===l)).filter(l=>l.length)),a=R(()=>r().length?"No agents match this filter.":"No agents loaded.");return E(H,{get when(){return i()},children:l=>E(Le,{get title(){return(()=>{var c=j8();return c.firstChild,h(c,E(Ee,{get children(){return r().length}}),null),c})()},description:"Agents are reusable model, prompt, and tool configurations. Primary agents drive sessions; subagents are delegated to.",get actions(){return E(eA,{icon:"plus",variant:"primary",onClick:()=>A.nav(A.href("new")),children:"New agent"})},get children(){return[E(L1,{label:"Filter agents",get value(){return t()},placeholder:"Filter by name or ID...",onValue:n}),(()=>{var c=V8();return h(c,E(H,{get when(){return s().length},get fallback(){return(()=>{var g=z8();return h(g,a),g})()},get children(){return E(hA,{get each(){return s()},children:g=>(()=>{var d=$8();return h(d,E(H,{get when(){return e.query()?.scope==="project"},get children(){return E(tt,{get children(){return Fb(g[0]?.rank??1)}})}}),null),h(d,E(hA,{each:g,children:Q=>(()=>{var B=W8();return h(B,E(d1,{get leading(){return(()=>{var C=Z8();return Y(()=>V(C,"data-mode",Q.item.mode)),C})()},get title(){return Vi(Q.item)},get subtitle(){return(()=>{var C=X8(),I=C.firstChild,f=I.nextSibling;return h(I,()=>Q.item.name),h(f,()=>lQ(Q.item)),C})()},get status(){return(()=>{var C=Ab();return h(C,E(qA,{get tone(){return Q.item.mode==="primary"?"brand":"neutral"},get children(){return Q.item.mode}}),null),h(C,E(qA,{get children(){return Q.item.native?"Native":"Custom"}}),null),h(C,E(H,{get when(){return Q.item.hidden},get children(){return E(qA,{children:"Hidden"})}}),null),h(C,E(H,{get when(){return Q.item.deprecated},get children(){return E(qA,{children:"Deprecated"})}}),null),h(C,E(H,{get when(){return Q.entry},children:I=>E(de,{get source(){return I().source},get inherited(){return I().inherited},get overridden(){return I().overridden}})}),null),C})()},get actions(){return E(ke,{get icon(){return Og(Q.item,Q.entry)?"edit":"eye"},variant:"ghost",get"aria-label"(){return`${Og(Q.item,Q.entry)?"Edit":"Inspect"} ${Vi(Q.item)}`},onClick:()=>A.nav(A.href(Q.item.name))})}})),Y(()=>B.classList.toggle("inherited",!!Q.entry?.inherited)),B})()}),null),d})()})}})),c})()]}})})}function cQ(){const A=fu(),e=so(),t=()=>e.agentID==="new"?void 0:e.agentID,n=q8(t),i=R(()=>t()?n.locked()?"Inspect Agent":"Edit Agent":"Agent Builder");return E(H,{get when(){return n.snap()},children:r=>E(Le,{get title(){return i()},description:"Build a reusable agent by combining a prompt, model, mode, and tool permissions.",get actions(){return[E(eA,{variant:"secondary",get disabled(){return!!n.ctx.saving()||!n.ready()},get onClick(){return n.openMarkdown},children:"Markdown"}),E(H,{get when(){return!n.locked()},get children(){return E(eA,{variant:"primary",get disabled(){return!!n.ctx.saving()||!n.ready()},get onClick(){return n.save},children:"Save"})}}),E(ke,{icon:"close",variant:"secondary","aria-label":"Close agent builder",onClick:()=>A.nav(A.href())})]},get children(){return[(()=>{var o=Bb(),s=o.firstChild;return h(s,E(RA,{class:"ui-card agent-builder-card",padding:0,get children(){return[eb(),(()=>{var a=sQ();return h(a,E(Vt,{label:"Agent id",description:"Used in @ mentions, commands, and agent files.",get children(){var l=tb();return l.$$input=c=>n.setId(c.currentTarget.value),V(l,"spellcheck",!1),Y(()=>l.readOnly=n.locked()),Y(()=>l.value=n.id()),l}}),null),h(a,E(Vt,{label:"Description",description:"Shown when choosing or delegating to the agent.",get children(){var l=nb();return l.$$input=c=>n.setDesc(c.currentTarget.value),Y(()=>l.readOnly=n.locked()),Y(()=>l.value=n.desc()),l}}),null),h(a,E(Vt,{label:"Mode",description:"Primary agents can run sessions directly; subagents are delegated to by other agents.",get children(){return E(M1,{label:"Agent mode",get value(){return n.mode()},options:_b,get disabled(){return n.locked()},get onSelect(){return n.setMode}})}}),null),h(a,E(Vt,{label:"Color",get children(){var l=ib(),c=l.firstChild,g=c.nextSibling;return c.$$input=d=>n.setColor(d.currentTarget.value),h(g,E(hA,{each:Lb,children:d=>(()=>{var Q=Ib();return Q.$$click=()=>n.setColor(d),V(Q,"aria-label",`Use color ${d}`),Qt(Q,"background-color",d),Y(B=>{var C=n.color()===d,I=n.locked();return C!==B.e&&Q.classList.toggle("selected",B.e=C),I!==B.t&&(Q.disabled=B.t=I),B},{e:void 0,t:void 0}),Q})()})),Y(()=>c.readOnly=n.locked()),Y(()=>c.value=n.color()),l}}),null),h(a,E(Vt,{label:"Max steps",description:"Optional hard cap on tool-call iterations.",get children(){var l=rb();return l.$$input=c=>n.setSteps(c.currentTarget.value),Y(()=>l.readOnly=n.locked()),Y(()=>l.value=n.steps()),l}}),null),a})()]}}),null),h(s,E(RA,{class:"ui-card agent-builder-card",padding:0,get children(){return[ob(),(()=>{var a=sQ();return h(a,E(Vt,{label:"Model",description:"Leave unset to inherit the default model, or choose one to pin this agent to a specific model.",get actions(){return[E(H,{get when(){return IA(()=>!n.locked())()&&n.model()},get children(){return E(eA,{variant:"secondary",get disabled(){return!!n.ctx.saving()},get onClick(){return n.clearModel},children:"Use Default"})}}),E(ke,{icon:"edit",variant:"secondary","aria-label":"Edit agent model",get disabled(){return!!n.ctx.saving()||n.locked()},get onClick(){return n.openModel}})]},get children(){return E(H,{get when(){return n.selected()},get fallback(){return[(()=>{var l=Il();return h(l,()=>n.model()||"Inherit default model"),l})(),E(H,{get when(){return n.model()},children:l=>(()=>{var c=aQ();return h(c,l),c})()})]},children:l=>[(()=>{var c=Il();return h(c,()=>`${l().provider.name} / ${l().model.name}`),c})(),(()=>{var c=aQ();return h(c,()=>l().id),c})()]})}}),null),h(a,E(Vt,{label:"Tool access",description:"Selected tools are written as allow permissions.",get actions(){return[E(H,{get when(){return IA(()=>!n.locked())()&&n.tools().length},get children(){return E(eA,{variant:"secondary",get disabled(){return!!n.ctx.saving()},get onClick(){return n.clearTools},children:"Clear"})}}),E(ke,{icon:"edit",variant:"secondary","aria-label":"Edit tool access",get disabled(){return!!n.ctx.saving()||n.locked()},get onClick(){return n.openTools}})]},get children(){return E(H,{get when(){return n.tools().length},get fallback(){return[fb(),pb()]},get children(){return[(()=>{var l=Il();return h(l,()=>Gb(n.tools())),l})(),(()=>{var l=sb();return h(l,E(hA,{get each(){return n.tools()},children:c=>E(qA,{children:c})})),l})()]}})}}),null),a})()]}}),null),h(s,E(RA,{class:"ui-card agent-builder-card",padding:0,get children(){return[ab(),(()=>{var a=gb(),l=a.firstChild,c=l.firstChild,g=c.nextSibling;return h(a,E(Vt,{label:"Prompt",get children(){var d=lb();return d.$$input=Q=>n.setPrompt(Q.currentTarget.value),Y(()=>d.readOnly=n.locked()),Y(()=>d.value=n.prompt()),d}}),l),h(g,E(hA,{each:N8,children:d=>E(eA,{variant:"secondary",get disabled(){return!!n.ctx.saving()||n.locked()},onClick:()=>n.insert(d),children:d})})),a})()]}}),null),h(s,E(RA,{class:"ui-card agent-builder-card",padding:0,get children(){return[(()=>{var a=cb();return a.firstChild,h(a,E(Ee,{get children(){return n.rules().length}}),null),a})(),(()=>{var a=Qb(),l=a.firstChild,c=l.firstChild,g=c.firstChild;return h(l,E(hA,{get each(){return n.permissionGroups()},children:d=>(()=>{var Q=mb(),B=Q.firstChild,C=B.firstChild,I=C.firstChild,f=I.nextSibling,u=f.nextSibling,p=C.nextSibling,w=B.nextSibling;return h(I,()=>d.title),h(f,()=>d.id),h(u,()=>d.description),h(p,E(Ee,{get children(){return d.rules.length}}),null),h(p,E(eA,{icon:"plus",variant:"primary",get disabled(){return!!n.ctx.saving()||n.locked()},onClick:()=>n.openPermission(d.id),children:"Add rule"}),null),h(Q,E(d1,{title:"Default method",get subtitle(){return`Used for ${d.noun}s that do not match a specific rule.`},get actions(){return E(Ii,{get label(){return`Default method for ${d.title}`},get value(){return d.action},get disabled(){return!!n.ctx.saving()||n.locked()},onSelect:m=>n.setPermissionDefault(d.id,m)})}}),w),h(w,E(H,{get when(){return d.rules.length},get fallback(){return(()=>{var m=wb(),y=m.firstChild,M=y.nextSibling;return M.nextSibling,h(m,()=>d.noun,M),m})()},get children(){return E(hA,{get each(){return d.rules},children:m=>E(d1,{get title(){return(()=>{var y=yb();return h(y,()=>m.pattern),y})()},get subtitle(){return`${d.title} ${d.noun} rule`},get status(){return E(gQ,{get action(){return m.action}})},get actions(){return E(ke,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${d.title} rule ${m.pattern}`},get disabled(){return!!n.ctx.saving()||n.locked()},onClick:()=>n.removePermission(m)})}})})}})),Q})()}),c),h(c,E(tt,{get trailing(){return E(Ee,{get children(){return n.permissionDefaults().length}})},description:"Default methods for additional built-in tool permissions.",children:"Tool Defaults"}),g),h(g,E(hA,{get each(){return n.permissionDefaults()},children:d=>E(d1,{get title(){return d.title},get subtitle(){return`${d.id} · ${d.description}`},get actions(){return E(Ii,{get label(){return`Default method for ${d.title}`},get value(){return d.action},get disabled(){return!!n.ctx.saving()||n.locked()},onSelect:Q=>n.setPermissionDefault(d.id,Q)})}})})),h(l,E(H,{get when(){return n.permissionOther().length},get children(){var d=db(),Q=d.firstChild;return h(d,E(tt,{get trailing(){return E(Ee,{get children(){return n.permissionOther().length}})},description:"Additional tool permission rules from this agent.",children:"Other Permissions"}),Q),h(Q,E(hA,{get each(){return n.permissionOther()},children:B=>E(d1,{get title(){return Et(B.tool)},get subtitle(){return(()=>{var C=Db(),I=C.firstChild,f=I.nextSibling;return h(I,()=>B.tool),h(f,()=>B.pattern),C})()},get status(){return E(gQ,{get action(){return B.action}})},get actions(){return E(ke,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${B.tool} rule ${B.pattern}`},get disabled(){return!!n.ctx.saving()||n.locked()},onClick:()=>n.removePermission(B)})}})})),d}}),null),a})()]}}),null),o})(),E(H,{get when(){return n.panel()==="model"},get children(){return[(()=>{var o=ko();return zA(o,"click",n.close,!0),o})(),(()=>{var o=Eb(),s=o.firstChild;s.firstChild;var a=s.nextSibling,l=a.nextSibling;return h(s,E(eA,{variant:"ghost","aria-label":"Close model selector",get onClick(){return n.close},children:"X"}),null),h(o,E(L1,{class:"drawer-search",hideLabel:!1,label:"Filter models",get value(){return n.picker()},variant:"drawer",placeholder:"Search by name, provider, or ID",get onValue(){return n.setPicker}}),a),h(a,E(H,{get when(){return n.models().length},get fallback(){return kb()},get children(){return E(hA,{get each(){return n.models()},children:c=>(()=>{var g=bb(),d=g.firstChild,Q=d.nextSibling,B=Q.firstChild,C=B.nextSibling,I=Q.nextSibling;return g.$$click=()=>n.selectModel(c),h(B,()=>c.model.name),h(C,()=>c.id),h(I,E(qA,{get children(){return c.provider.name}}),null),h(I,E(qA,{get children(){return c.model.isFree?"free":"paid"}}),null),Y(f=>{var u=n.choice()===c.id,p=!!n.fav(c);return u!==f.e&&g.classList.toggle("selected",f.e=u),p!==f.t&&d.classList.toggle("active",f.t=p),f},{e:void 0,t:void 0}),g})()})}})),h(l,E(eA,{variant:"ghost",get onClick(){return n.close},children:"Cancel"}),null),h(l,E(eA,{variant:"primary",get disabled(){return!!n.ctx.saving()||n.locked()||!n.choice()},get onClick(){return n.saveModel},children:"Save"}),null),o})()]}}),E(H,{get when(){return n.panel()==="tools"},get children(){return[(()=>{var o=ko();return zA(o,"click",n.close,!0),o})(),(()=>{var o=Cb(),s=o.firstChild;s.firstChild;var a=s.nextSibling,l=a.nextSibling;return h(s,E(eA,{variant:"ghost","aria-label":"Close tool selector",get onClick(){return n.close},children:"X"}),null),h(o,E(L1,{class:"drawer-search",hideLabel:!1,label:"Filter tools",get value(){return n.search()},variant:"drawer",placeholder:"Search by tool name, ID, or capability",get onValue(){return n.setSearch}}),a),h(a,E(H,{get when(){return n.options().length},get fallback(){return vb()},get children(){return E(hA,{get each(){return n.options()},children:c=>(()=>{var g=Mb(),d=g.firstChild,Q=d.firstChild,B=Q.firstChild,C=B.firstChild,I=C.nextSibling,f=Q.nextSibling,u=d.nextSibling;return g.$$click=()=>n.toggleTool(c.id),h(C,()=>Et(c.id)),h(I,()=>c.id),h(f,E(qA,{get children(){return n.pickedDraft().has(c.id)?"Allowed":"Off"}})),h(u,E(hA,{get each(){return e0(c)},children:p=>(()=>{var w=Nb();return h(w,p),w})()})),Y(p=>{var w=!!n.pickedDraft().has(c.id),m=n.pickedDraft().has(c.id);return w!==p.e&&g.classList.toggle("selected",p.e=w),m!==p.t&&V(g,"aria-pressed",p.t=m),p},{e:void 0,t:void 0}),g})()})}})),h(l,E(eA,{variant:"ghost",get onClick(){return n.close},children:"Cancel"}),null),h(l,E(eA,{variant:"primary",get disabled(){return!!n.ctx.saving()||n.locked()},get onClick(){return n.saveTools},children:"Save"}),null),o})()]}}),E(H,{get when(){return n.panel()==="permission"},get children(){return[(()=>{var o=ko();return zA(o,"click",n.close,!0),o})(),(()=>{var o=ub(),s=o.firstChild,a=s.firstChild,l=a.firstChild,c=l.nextSibling,g=s.nextSibling,d=g.firstChild,Q=d.firstChild,B=d.nextSibling;B.firstChild;var C=g.nextSibling;return h(l,()=>`Add ${n.selectedPermission().title} Rule`),h(c,()=>`${n.selectedPermission().id} · ${n.selectedPermission().description}`),h(s,E(eA,{variant:"ghost","aria-label":"Close permission rule overlay",get onClick(){return n.close},children:"X"}),null),h(d,()=>n.selectedPermission().noun==="command"?"Command pattern":"Path pattern",Q),Q.$$input=I=>n.setPermPattern(I.currentTarget.value),V(Q,"spellcheck",!1),h(B,E(Ii,{label:"Rule method",get value(){return n.permAction()},get disabled(){return!!n.ctx.saving()||n.locked()},get onSelect(){return n.setPermAction}}),null),h(C,E(eA,{variant:"ghost",get onClick(){return n.close},children:"Cancel"}),null),h(C,E(eA,{variant:"primary",get disabled(){return!!n.ctx.saving()||n.locked()},get onClick(){return n.addPermission},children:"Save Rule"}),null),Y(I=>{var f=n.selectedPermission().placeholder,u=n.locked();return f!==I.e&&V(Q,"placeholder",I.e=f),u!==I.t&&(Q.readOnly=I.t=u),I},{e:void 0,t:void 0}),Y(()=>Q.value=n.permPattern()),o})()]}}),E(H,{get when(){return n.panel()==="markdown"},get children(){return[(()=>{var o=ko();return zA(o,"click",n.close,!0),o})(),(()=>{var o=hb(),s=o.firstChild,a=s.firstChild,l=a.firstChild,c=l.nextSibling,g=s.nextSibling;return h(c,()=>n.draft()?.path??"Previewing the current agent configuration."),h(s,E(eA,{variant:"ghost","aria-label":"Close markdown preview",get onClick(){return n.close},children:"X"}),null),h(g,E(H,{get when(){return n.draft()},get fallback(){return Sb()},children:d=>(()=>{var Q=xb();return h(Q,()=>d().markdown),Q})()})),o})()]}})]}})})}ie(["input","click"]);const Ub=["#0c0a09","#fafaf9","#f9f76f","#a6a09b","#3794ff","#44403b"],fl=[{id:"aura",swatches:["#0f0f0f","#edecee","#a277ff","#f694ff","#a277ff","#2d2d2d"]},{id:"ayu",swatches:["#0B0E14","#BFBDB6","#59C2FF","#D2A6FF","#E6B450","#6C7380"]},{id:"carbonfox",swatches:["#161616","#f2f4f8","#33b1ff","#78a9ff","#ff7eb6","#303030"]},{id:"catppuccin",swatches:["#1e1e2e","#cdd6f4","#89b4fa","#cba6f7","#f5c2e7","#313244"]},{id:"catppuccin-frappe",swatches:["#303446","#c6d0f5","#8da4e2","#ca9ee6","#f4b8e4","#414559"]},{id:"catppuccin-macchiato",swatches:["#24273a","#cad3f5","#8aadf4","#c6a0f6","#f5bde6","#363a4f"]},{id:"cobalt2",swatches:["#193549","#ffffff","#0088ff","#9a5feb","#2affdf","#1f4662"]},{id:"colorblind",swatches:["#1A1A2E","#E8E8E8","#0077BB","#EE7733","#33BBEE","#1F4068"]},{id:"cursor",swatches:["#181818","#e4e4e4","#88c0d0","#81a1c1","#88c0d0","#e4e4e413"]},{id:"dracula",swatches:["#282a36","#f8f8f2","#bd93f9","#ff79c6","#8be9fd","#44475a"]},{id:"everforest",swatches:["#2d353b","#d3c6aa","#a7c080","#7fbbb3","#d699b6","#859289"]},{id:"flexoki",swatches:["#100F0F","#CECDC3","#DA702C","#4385BE","#8B7EC8","#575653"]},{id:"github",swatches:["#0d1117","#c9d1d9","#58a6ff","#bc8cff","#39c5cf","#30363d"]},{id:"gruvbox",swatches:["#282828","#ebdbb2","#83a598","#d3869b","#8ec07c","#665c54"]},{id:"kanagawa",swatches:["#1F1F28","#DCD7BA","#7E9CD8","#957FB8","#D27E99","#54546D"]},{id:"kilo",swatches:["#0c0a09","#fafaf9","#f9f76f","#a6a09b","#f9f76f","#44403b"]},{id:"kilo-v1",swatches:["#1e1e1e","#cccccc","#faf74f","#007acc","#007fd4","#3c3c3c"]},{id:"lucent-orng",swatches:["#000000","#eeeeee","#EC5B2B","#EE7948","#FFF7F1","#EC5B2B"]},{id:"material",swatches:["#263238","#eeffff","#82aaff","#c792ea","#89ddff","#37474f"]},{id:"matrix",swatches:["#0a0e0a","#62ff94","#2eff6a","#00efff","#c770ff","#1e2a1b"]},{id:"mercury",swatches:["#171721","#dddde5","#8da4f5","#a7b6f8","#8da4f5","#b4b7c81f"]},{id:"monokai",swatches:["#272822","#f8f8f2","#66d9ef","#ae81ff","#a6e22e","#3e3d32"]},{id:"nightowl",swatches:["#011627","#d6deeb","#82AAFF","#7fdbca","#c792ea","#5f7e97"]},{id:"nord",swatches:["#2E3440","#ECEFF4","#88C0D0","#81A1C1","#8FBCBB","#434C5E"]},{id:"one-dark",swatches:["#282c34","#abb2bf","#61afef","#c678dd","#56b6c2","#393f4a"]},{id:"opencode",swatches:["#0a0a0a","#eeeeee","#fab283","#5c9cf5","#9d7cd8","#484848"]},{id:"orng",swatches:["#0a0a0a","#eeeeee","#EC5B2B","#EE7948","#FFF7F1","#EC5B2B"]},{id:"osaka-jade",swatches:["#111c18","#C1C497","#2DD5B7","#D2689C","#549e6a","#3d4a44"]},{id:"palenight",swatches:["#292d3e","#a6accd","#82aaff","#c792ea","#89ddff","#32364a"]},{id:"rosepine",swatches:["#191724","#e0def4","#9ccfd8","#c4a7e7","#ebbcba","#403d52"]},{id:"solarized",swatches:["#002b36","#839496","#268bd2","#6c71c4","#2aa198","#073642"]},{id:"synthwave84",swatches:["#262335","#ffffff","#36f9f6","#ff7edb","#b084eb","#495495"]},{id:"tokyonight",swatches:["#1a1b26","#c8d3f5","#82aaff","#c099ff","#ff966c","#737aa2"]},{id:"vercel",swatches:["#000000","#EDEDED","#0070F3","#52A8FF","#8E4EC6","#1F1F1F"]},{id:"vesper",swatches:["#101010","#FFF","#FFC799","#99FFE4","#FFC799","#282828"]},{id:"zenburn",swatches:["#3f3f3f","#dcdccc","#8cd0d3","#dc8cc3","#93e0e3","#5f5f5f"]}];function o0(A){return A.split("-").filter(Boolean).map(e=>`${e[0]?.toUpperCase()??""}${e.slice(1)}`).join(" ")}function dQ(A){return{id:A,swatches:Ub,custom:!0}}function Tb(A){return A==="stacked"?"stacked":"auto"}function ur(A,e){return typeof A=="boolean"?A:e}function Ob(){const A=xe(),e=R(()=>A.data()?.tui.theme??"kilo"),[t,n]=T(""),[i,r]=T("closed"),[o,s]=T(""),[a,l]=T(""),[c,g]=T("3"),[d,Q]=T(!1),[B,C]=T("auto"),[I,f]=T(!0),[u,p]=T(!1),w=R(()=>{const G=LA(o()).toLowerCase(),K=fl.filter(J=>G?`${J.id} ${o0(J.id)}`.toLowerCase().includes(G):!0),q=LA(o());return!q||fl.some(J=>J.id===q)||K.length?K:[dQ(q)]});function m(G){return fl.find(K=>K.id===G)??dQ(G||"kilo")}const y=R(()=>m(t())),M=R(()=>m(a()||t()));iA(()=>{const G=A.data()?.tui;n(e()),!u()&&(g(String(G?.scroll_speed??3)),Q(ur(G?.scroll_acceleration?.enabled,!1)),C(Tb(G?.diff_style)),f(ur(G?.mouse,!0)))});function v(){l(t()),s(""),r("theme")}function N(){r("closed")}function _(G){l(G.id)}function F(G){p(!0),G()}function x(){const G=LA(a());if(!G){A.fail("Select a TUI theme before saving.");return}A.tui({theme:G}),n(G),N()}function S(){const G=Number(c());if(!Number.isFinite(G)||G<.001){A.fail("Enter a scroll speed of at least 0.001.");return}const K={scroll_speed:G,scroll_acceleration:{enabled:d()},diff_style:B(),mouse:I()};A.tui(K),p(!1)}return{ctx:A,current:e,theme:t,active:y,selected:M,mode:i,picker:o,setPicker:s,choice:a,options:w,edit:v,close:N,select:_,saveTheme:x,speed:c,setSpeed:G=>F(()=>g(G)),accel:d,setAccel:G=>F(()=>Q(G)),diff:B,setDiff:G=>F(()=>C(G)),mouse:I,setMouse:G=>F(()=>f(G)),dirty:u,save:S}}function Kb(){const A=xe(),[e,t]=T(!1),[n,i]=T(!0),[r,o]=T(!0),[s,a]=T("0.4"),[l,c]=T("none"),[g,d]=T(!1);iA(()=>{if(g())return;const C=A.data()?.tui,I=C?.attention;t(ur(I?.enabled,!1)),i(ur(I?.notifications,!0)),o(ur(I?.sound,!0)),a(String(I?.volume??.4)),c(C?.title_icon??"none")});function Q(C){d(!0),C()}function B(){const C=Number(s());if(!Number.isFinite(C)||C<0||C>1){A.fail("Enter an attention volume between 0 and 1.");return}A.tui({title_icon:l(),attention:{enabled:e(),notifications:n(),sound:r(),volume:C}}),d(!1)}return{ctx:A,alert:e,setAlert:C=>Q(()=>t(C)),notify:n,setNotify:C=>Q(()=>i(C)),sound:r,setSound:C=>Q(()=>o(C)),volume:s,setVolume:C=>Q(()=>a(C)),icon:l,setIcon:C=>Q(()=>c(C)),dirty:g,save:B}}var qb=k("<button class=ui-toggle type=button><span><strong></strong><small>"),Jb=k("<header class=ui-card-header><div><h2>Terminal title</h2><p>Choose how session status appears in the terminal tab title."),Hb=k("<div class=ui-form><div class=ui-field><span>Title Icon</span><small>None hides status icons. Unicode and Emojis show working, attention, and finished states."),Yb=k("<header class=ui-card-header><div><h2>Attention</h2><p>Control when the TUI asks for attention and how it notifies you."),Pb=k('<div class="ui-form attention-form"><label class=ui-field><span>Volume</span><input type=number min=0 max=1 step=0.05><small>Use a value from 0 to 1. The docs example uses 0.4.'),Vb=k("<div class=ui-settings>");const jb=[{value:"none",label:"None"},{value:"unicode",label:"Unicode"},{value:"emojis",label:"Emojis"}];function pl(A){return(()=>{var e=qb(),t=e.firstChild,n=t.firstChild,i=n.nextSibling;return zA(e,"click",A.onChange,!0),h(n,()=>A.label),h(i,()=>A.description),h(e,E(qA,{get tone(){return A.checked?"success":"neutral"},get children(){return A.checked?"On":"Off"}}),null),Y(r=>{var o=!!A.checked,s=A.checked,a=A.disabled;return o!==r.e&&e.classList.toggle("selected",r.e=o),s!==r.t&&V(e,"aria-pressed",r.t=s),a!==r.a&&(e.disabled=r.a=a),r},{e:void 0,t:void 0,a:void 0}),e})()}function zb(){const A=Kb();return E(Le,{title:"CLI Notifications",description:"Configure terminal title indicators, TUI attention alerts, desktop notifications, and sound defaults.",get actions(){return E(eA,{variant:"primary",get disabled(){return!!A.ctx.saving()||!A.dirty()},get onClick(){return A.save},children:"Save"})},get children(){var e=Vb();return h(e,E(RA,{class:"ui-card",padding:0,get children(){return[Jb(),(()=>{var t=Hb(),n=t.firstChild,i=n.firstChild,r=i.nextSibling;return h(n,E(M1,{class:"title-icon-select",label:"Title Icon",get value(){return A.icon()},options:jb,get disabled(){return!!A.ctx.saving()},get onSelect(){return A.setIcon}}),r),t})()]}}),null),h(e,E(RA,{class:"ui-card",padding:0,get children(){return[Yb(),(()=>{var t=Pb(),n=t.firstChild,i=n.firstChild,r=i.nextSibling;return h(t,E(pl,{label:"Attention alerts",description:"Turn on TUI attention events.",get checked(){return A.alert()},get disabled(){return!!A.ctx.saving()},onChange:()=>A.setAlert(!A.alert())}),n),h(t,E(pl,{label:"Desktop notifications",description:"Show desktop notifications when attention alerts fire.",get checked(){return A.notify()},get disabled(){return!!A.ctx.saving()||!A.alert()},onChange:()=>A.setNotify(!A.notify())}),n),h(t,E(pl,{label:"Sound",description:"Play an attention sound when alerts fire.",get checked(){return A.sound()},get disabled(){return!!A.ctx.saving()||!A.alert()},onChange:()=>A.setSound(!A.sound())}),n),r.$$input=o=>A.setVolume(o.currentTarget.value),Y(()=>r.disabled=!A.alert()),Y(()=>r.value=A.volume()),t})()]}}),null),e}})}ie(["click","input"]);var $b=k("<div class=theme-swatches aria-hidden=true>"),Wb=k("<span class=theme-swatch>"),Zb=k("<div class=theme-preview><div><strong></strong><span class=mono>"),Xb=k("<button class=ui-toggle type=button><span><strong></strong><small>"),A7=k("<header class=ui-card-header><div><h2>Theme</h2><p>Choose the TUI palette. Custom theme IDs can still be typed in the selector search."),e7=k("<div class=ui-card-body>"),t7=k("<header class=ui-card-header><div><h2>Interaction</h2><p>Control mouse capture, scrolling, and diff rendering behavior in the terminal."),n7=k("<div class=ui-form><label class=ui-field><span>Diff style</span><small>Auto adapts to terminal width; stacked always uses a single-column diff.</small></label><label class=ui-field><span>Scroll speed</span><input type=number min=0.001 step=0.25><small>Default is 3. Use lower values for slower scrolling."),i7=k("<div class=ui-settings>"),r7=k("<div class=drawer-scrim>"),o7=k('<aside class="provider-drawer theme-drawer"aria-label="Theme selector"><header class=drawer-header><div><h2>Choose Theme</h2><span>Select a built-in theme or type a custom theme ID in search.</span></div></header><div class="provider-picker theme-picker"></div><footer class="drawer-footer theme-footer"><div>'),s7=k("<p class=empty>No themes match this filter."),a7=k('<button class="provider-option theme-option"type=button><div><strong></strong><span>');const l7=[{value:"auto",label:"Auto"},{value:"stacked",label:"Stacked"}];function pu(A){return(()=>{var e=$b();return h(e,E(hA,{get each(){return A.swatches},children:t=>(()=>{var n=Wb();return Qt(n,"background-color",t),n})()})),e})()}function QQ(A){return(()=>{var e=Zb(),t=e.firstChild,n=t.firstChild,i=n.nextSibling;return h(n,()=>o0(A.item.id)),h(i,(()=>{var r=IA(()=>!!A.item.custom);return()=>r()?`${A.item.id} / custom`:A.item.id})()),h(e,E(pu,{get swatches(){return A.item.swatches}}),null),e})()}function BQ(A){return(()=>{var e=Xb(),t=e.firstChild,n=t.firstChild,i=n.nextSibling;return zA(e,"click",A.onChange,!0),h(n,()=>A.label),h(i,()=>A.description),h(e,E(qA,{get tone(){return A.checked?"success":"neutral"},get children(){return A.checked?"On":"Off"}}),null),Y(r=>{var o=!!A.checked,s=A.checked,a=A.disabled;return o!==r.e&&e.classList.toggle("selected",r.e=o),s!==r.t&&V(e,"aria-pressed",r.t=s),a!==r.a&&(e.disabled=r.a=a),r},{e:void 0,t:void 0,a:void 0}),e})()}function g7(){const A=Ob();return E(Le,{title:"CLI UI",description:"Configure terminal UI preferences saved in tui.json.",get actions(){return E(eA,{variant:"primary",get disabled(){return!!A.ctx.saving()||!A.dirty()},get onClick(){return A.save},children:"Save"})},get children(){return[(()=>{var e=i7();return h(e,E(RA,{class:"ui-card ui-theme-card",padding:0,get children(){return[(()=>{var t=A7();return t.firstChild,h(t,E(eA,{variant:"secondary",get disabled(){return!!A.ctx.saving()},get onClick(){return A.edit},children:"Change Theme"}),null),t})(),(()=>{var t=e7();return h(t,E(QQ,{get item(){return A.active()}})),t})()]}}),null),h(e,E(RA,{class:"ui-card",padding:0,get children(){return[t7(),(()=>{var t=n7(),n=t.firstChild,i=n.firstChild,r=i.nextSibling,o=n.nextSibling,s=o.firstChild,a=s.nextSibling;return h(n,E(M1,{label:"Diff style",get value(){return A.diff()},options:l7,get onSelect(){return A.setDiff}}),r),a.$$input=l=>A.setSpeed(l.currentTarget.value),h(t,E(BQ,{label:"Mouse capture",description:"Allow the TUI to receive mouse input. Defaults to on.",get checked(){return A.mouse()},get disabled(){return!!A.ctx.saving()},onChange:()=>A.setMouse(!A.mouse())}),null),h(t,E(BQ,{label:"Scroll acceleration",description:"Enable macOS-style scroll acceleration.",get checked(){return A.accel()},get disabled(){return!!A.ctx.saving()},onChange:()=>A.setAccel(!A.accel())}),null),Y(()=>a.value=A.speed()),t})()]}}),null),e})(),E(H,{get when(){return A.mode()==="theme"},get children(){return[(()=>{var e=r7();return zA(e,"click",A.close,!0),e})(),(()=>{var e=o7(),t=e.firstChild;t.firstChild;var n=t.nextSibling,i=n.nextSibling,r=i.firstChild;return h(t,E(eA,{variant:"ghost","aria-label":"Close theme selector",get onClick(){return A.close},children:"X"}),null),h(e,E(L1,{class:"drawer-search",hideLabel:!1,label:"Filter themes",get value(){return A.picker()},variant:"drawer",placeholder:"Search theme or type a custom ID",get onValue(){return A.setPicker}}),n),h(n,E(H,{get when(){return A.options().length},get fallback(){return s7()},get children(){return E(hA,{get each(){return A.options()},children:o=>(()=>{var s=a7(),a=s.firstChild,l=a.firstChild,c=l.nextSibling;return s.$$click=()=>A.select(o),h(l,()=>o0(o.id)),h(c,(()=>{var g=IA(()=>!!o.custom);return()=>g()?`${o.id} / custom theme`:o.id})()),h(s,E(pu,{get swatches(){return o.swatches}}),null),Y(()=>s.classList.toggle("selected",A.choice()===o.id)),s})()})}})),h(i,E(QQ,{get item(){return A.selected()}}),r),h(r,E(eA,{variant:"ghost",get onClick(){return A.close},children:"Cancel"}),null),h(r,E(eA,{variant:"primary",get disabled(){return!!A.ctx.saving()||!A.choice()},get onClick(){return A.saveTheme},children:"Save Theme"}),null),e})()]}})]}})}ie(["click","input"]);var c7=k("<svg>"),d7=k("<svg><rect width=3 height=3 rx=1></svg>",!1,!0,!1);const Q7=new Set([1,2,4,7,8,11,13,14]),B7=new Set([0,3,12,15]),E7=Array.from({length:16},(A,e)=>({id:e,x:e%4*4,y:Math.floor(e/4)*4,delay:Math.random()*1.5,duration:1+Math.random()*1,outer:Q7.has(e),corner:B7.has(e)}));function s0(A){return(()=>{var e=c7();return e1(e,fA(A,{viewBox:"0 0 15 15","data-component":"spinner",get classList(){return{...A.classList,[A.class??""]:!!A.class}},fill:"currentColor"}),!0,!0),h(e,E(hA,{each:E7,children:t=>(()=>{var n=d7();return Y(i=>{var r=t.x,o=t.y,s=t.corner?0:void 0,a=t.corner?void 0:`${t.outer?"pulse-opacity-dim":"pulse-opacity"} ${t.duration}s ease-in-out infinite`,l=t.corner?void 0:"both",c=t.corner?void 0:`${t.delay}s`;return r!==i.e&&V(n,"x",i.e=r),o!==i.t&&V(n,"y",i.t=o),s!==i.a&&Qt(n,"opacity",i.a=s),a!==i.o&&Qt(n,"animation",i.o=a),l!==i.i&&Qt(n,"animation-fill-mode",i.i=l),c!==i.n&&Qt(n,"animation-delay",i.n=c),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),n})()})),e})()}const Ls=300,Fn=250,wi=800,_s="unified";function Kg(A){return A==="split"?"split":_s}function qg(A){return typeof A!="number"||!Number.isFinite(A)?Ls:Math.min(wi,Math.max(Fn,Math.round(A)))}function C7(A){const e=Number(A);if(Number.isInteger(e)&&!(e<Fn||e>wi))return e}function u7(){const A=xe(),[e,t]=T(String(Ls)),[n,i]=T(_s),[r,o]=T(!1);iA(()=>{if(r())return;const l=A.data()?.effective.console;t(String(qg(l?.context_sidebar_width))),i(Kg(l?.diff_style))});function s(){const l=C7(e());if(l===void 0){A.fail(`Enter a sidebar width between ${Fn} and ${wi} pixels.`);return}A.patch({console:{context_sidebar_width:l,diff_style:n()}}),t(String(l)),o(!1)}function a(){A.unset([["console","context_sidebar_width"],["console","diff_style"]]),t(String(Ls)),i(_s),o(!1)}return{ctx:A,width:e,setWidth:l=>{t(l),o(!0)},style:n,setStyle:l=>{i(Kg(l)),o(!0)},dirty:r,configured:()=>{const l=A.data()?.effective.console;return l?.context_sidebar_width!==void 0||l?.diff_style!==void 0},save:s,reset:a}}var h7=k("<header class=ui-card-header><div><h2>Project context sidebar</h2><p>Set the default width used by the Context and Changes panel in project consoles."),I7=k("<div class=ui-form><label class=ui-field><span>Sidebar width</span><input type=number step=1><small>Width in pixels, between <!> and <!>. You can also resize the sidebar by dragging its left edge."),f7=k("<header class=ui-card-header><div><h2>Diff review</h2><p>Choose the default layout used when reviewing changed files in project consoles."),p7=k("<div class=ui-form><div class=ui-field><span>Diff layout</span><small>Unified shows changes in one column. Split shows the original and modified file side by side."),m7=k("<div class=ui-settings>");const w7=[{value:"unified",label:"Unified"},{value:"split",label:"Split"}];function y7(){const A=u7();return E(Le,{title:"Console UI",description:"Configure the local Kilo Console interface. These preferences are saved in your user config.",get actions(){return[E(H,{get when(){return A.configured()},get children(){return E(eA,{variant:"secondary",get disabled(){return!!A.ctx.saving()},get onClick(){return A.reset},children:"Use default"})}}),E(eA,{variant:"primary",get disabled(){return!!A.ctx.saving()||!A.dirty()},get"aria-busy"(){return!!A.ctx.saving()},get onClick(){return A.save},get children(){return[E(H,{get when(){return A.ctx.saving()},get children(){return E(s0,{})}}),"Save"]}})]},get children(){var e=m7();return h(e,E(RA,{class:"ui-card",padding:0,get children(){return[h7(),(()=>{var t=I7(),n=t.firstChild,i=n.firstChild,r=i.nextSibling,o=r.nextSibling,s=o.firstChild,a=s.nextSibling,l=a.nextSibling,c=l.nextSibling;return c.nextSibling,r.$$input=g=>A.setWidth(g.currentTarget.value),V(r,"min",Fn),V(r,"max",wi),h(o,Fn,a),h(o,wi,c),Y(()=>r.value=A.width()),t})()]}}),null),h(e,E(RA,{class:"ui-card",padding:0,get children(){return[f7(),(()=>{var t=p7(),n=t.firstChild,i=n.firstChild,r=i.nextSibling;return h(n,E(M1,{class:"console-diff-select",label:"Diff layout",get value(){return A.style()},options:w7,get disabled(){return!!A.ctx.saving()},get onSelect(){return A.setStyle}}),r),t})()]}}),null),e}})}ie(["input"]);const mu=[{id:"air",ext:[".R"],req:"air command available"},{id:"biome",ext:[".js",".jsx",".ts",".tsx",".html",".css",".md",".json",".yaml"],req:"biome.json(c) config file"},{id:"cargofmt",ext:[".rs"],req:"cargo fmt command available"},{id:"clang-format",ext:[".c",".cpp",".h",".hpp",".ino"],req:".clang-format config file"},{id:"cljfmt",ext:[".clj",".cljs",".cljc",".edn"],req:"cljfmt command available"},{id:"dart",ext:[".dart"],req:"dart command available"},{id:"dfmt",ext:[".d"],req:"dfmt command available"},{id:"gleam",ext:[".gleam"],req:"gleam command available"},{id:"gofmt",ext:[".go"],req:"gofmt command available"},{id:"htmlbeautifier",ext:[".erb",".html.erb"],req:"htmlbeautifier command available"},{id:"ktlint",ext:[".kt",".kts"],req:"ktlint command available"},{id:"latexindent",ext:[".tex"],req:"latexindent command available"},{id:"mix",ext:[".ex",".exs",".eex",".heex",".leex",".neex",".sface"],req:"mix command available"},{id:"nixfmt",ext:[".nix"],req:"nixfmt command available"},{id:"ocamlformat",ext:[".ml",".mli"],req:"ocamlformat command and .ocamlformat config file"},{id:"ormolu",ext:[".hs"],req:"ormolu command available"},{id:"oxfmt",ext:[".js",".jsx",".ts",".tsx"],req:"oxfmt dependency and experimental flag",note:"Experimental"},{id:"pint",ext:[".php"],req:"laravel/pint dependency in composer.json"},{id:"prettier",ext:[".js",".jsx",".ts",".tsx",".html",".css",".md",".json",".yaml"],req:"prettier dependency in package.json"},{id:"rubocop",ext:[".rb",".rake",".gemspec",".ru"],req:"rubocop command available"},{id:"ruff",ext:[".py",".pyi"],req:"ruff command available with config"},{id:"rustfmt",ext:[".rs"],req:"rustfmt command available"},{id:"shfmt",ext:[".sh",".bash"],req:"shfmt command available"},{id:"standardrb",ext:[".rb",".rake",".gemspec",".ru"],req:"standardrb command available"},{id:"terraform",ext:[".tf",".tfvars"],req:"terraform command available"},{id:"uv",ext:[".py",".pyi"],req:"uv command available"},{id:"zig",ext:[".zig",".zon"],req:"zig command available"}],wu=[{id:"astro",ext:[".astro"],req:"Auto-installs for Astro projects"},{id:"bash",ext:[".sh",".bash",".zsh",".ksh"],req:"Auto-installs bash-language-server"},{id:"biome",ext:[".js",".jsx",".ts",".tsx",".json",".jsonc",".css"],req:"biome dependency or config available"},{id:"clangd",ext:[".c",".cpp",".cc",".cxx",".c++",".h",".hpp",".hh",".hxx",".h++"],req:"Auto-installs for C/C++ projects"},{id:"clojure-lsp",ext:[".clj",".cljs",".cljc",".edn"],req:"clojure-lsp command available"},{id:"csharp",title:"C#",ext:[".cs",".csx"],req:".NET SDK installed"},{id:"dart",ext:[".dart"],req:"dart command available"},{id:"deno",ext:[".ts",".tsx",".js",".jsx",".mjs"],req:"deno command available with deno.json/c"},{id:"dockerfile",title:"Dockerfile",ext:["Dockerfile",".dockerfile"],req:"Docker language server available"},{id:"elixir-ls",ext:[".ex",".exs"],req:"elixir command available"},{id:"eslint",title:"ESLint",ext:[".ts",".tsx",".js",".jsx",".mjs",".cjs",".mts",".cts",".vue"],req:"eslint dependency in project"},{id:"fsharp",title:"F#",ext:[".fs",".fsi",".fsx",".fsscript"],req:".NET SDK installed"},{id:"gleam",ext:[".gleam"],req:"gleam command available"},{id:"gopls",ext:[".go"],req:"go command available"},{id:"haskell-language-server",title:"HLS",ext:[".hs",".lhs"],req:"haskell-language-server-wrapper command available"},{id:"jdtls",title:"JDTLS",ext:[".java"],req:"Java SDK 21+ installed"},{id:"julials",title:"JuliaLS",ext:[".jl"],req:"julia and LanguageServer.jl installed"},{id:"kotlin-ls",ext:[".kt",".kts"],req:"Auto-installs for Kotlin projects"},{id:"lua-ls",ext:[".lua"],req:"Auto-installs for Lua projects"},{id:"nixd",ext:[".nix"],req:"nixd command available"},{id:"ocaml-lsp",ext:[".ml",".mli"],req:"ocamllsp command available"},{id:"oxlint",ext:[".ts",".tsx",".js",".jsx",".mjs",".cjs",".mts",".cts",".vue",".astro",".svelte"],req:"oxlint dependency in project"},{id:"php intelephense",title:"PHP Intelephense",ext:[".php"],req:"Auto-installs for PHP projects"},{id:"prisma",ext:[".prisma"],req:"prisma command available"},{id:"pyright",ext:[".py",".pyi"],req:"pyright dependency installed"},{id:"razor",ext:[".razor",".cshtml"],req:".NET SDK and VS Code C# extension installed"},{id:"ruby-lsp",ext:[".rb",".rake",".gemspec",".ru"],req:"ruby and gem commands available"},{id:"rust",ext:[".rs"],req:"rust-analyzer command available"},{id:"sourcekit-lsp",ext:[".swift",".objc",".objcpp"],req:"swift installed, Xcode on macOS"},{id:"svelte",ext:[".svelte"],req:"Auto-installs for Svelte projects"},{id:"terraform",ext:[".tf",".tfvars"],req:"Auto-installs from GitHub releases"},{id:"texlab",ext:[".tex"],req:"Auto-installs texlab"},{id:"tinymist",ext:[".typ",".typc"],req:"Auto-installs from GitHub releases"},{id:"ty",title:"Ty",ext:[".py",".pyi"],req:"Experimental Python LSP",note:"Experimental"},{id:"typescript",title:"TypeScript",ext:[".ts",".tsx",".js",".jsx",".mjs",".cjs",".mts",".cts"],req:"typescript dependency in project"},{id:"vue",ext:[".vue"],req:"Auto-installs for Vue projects"},{id:"yaml-ls",title:"YAML LS",ext:[".yaml",".yml"],req:"Auto-installs Red Hat yaml-language-server"},{id:"zls",title:"ZLS",ext:[".zig",".zon"],req:"zig command available"}],D7=new Set(mu.map(A=>A.id)),k7=new Set(wu.map(A=>A.id));function Kt(A){return!A||typeof A!="object"||Array.isArray(A)?{}:A}function yu(A){return Array.isArray(A)?A.filter(e=>typeof e=="string"):[]}function EQ(A){return new Map(A.map(e=>[e.key,e]))}function CQ(A){return A===!0||!!(A&&typeof A=="object")}function bo(A){return Kt(A?.value).disabled===!0}function vo(A){return yu(Kt(A?.value).command)}function Mo(A,e){return Object.fromEntries(Object.entries(Kt(Kt(A?.value)[e])).filter(t=>typeof t[1]=="string"))}function uQ(A){return Kt(Kt(A?.value).initialization)}function ml(A,e,t){const n=yu(Kt(e?.value).extensions);return n.length?n:t.length?t:A.ext}function b7(A){return Object.entries(A).map(e=>`${e[0]}=${e[1]}`).join(`
|
|
23
23
|
`)}function v7(A){return Object.keys(A).length?JSON.stringify(A,null,2):""}function hQ(A){const e=A.split(`
|
|
@@ -806,7 +806,7 @@ ${e}`,n=A.startsWith(e)?0:iE(A,t,0);if(n===-1)return[A];const i=[];n>0&&i.push(A
|
|
|
806
806
|
|
|
807
807
|
${eq}
|
|
808
808
|
|
|
809
|
-
`;function z0(A){return{theme:sa,themeType:"system",disableLineNumbers:!1,overflow:"wrap",diffStyle:A??"unified",diffIndicators:"bars",lineHoverHighlight:"both",disableBackground:!1,expansionLineCount:20,hunkSeparators:"line-info-basic",lineDiffType:A==="split"?"word-alt":"none",maxLineDiffLength:1e3,maxLineLengthForHighlighting:1e3,disableFileHeader:!0,unsafeCSS:nq}}const Wf={"--diffs-font-family":"var(--font-family-mono)","--diffs-font-size":"var(--font-size-small)","--diffs-line-height":"24px","--diffs-tab-size":2,"--diffs-font-features":"var(--font-family-mono--font-feature-settings)","--diffs-header-font-family":"var(--font-family-sans)","--diffs-gap-block":0,"--diffs-min-number-column-width":"4ch"};function Zf(A){const e=A.closest("[data-line], [data-alt-line]");if(e instanceof HTMLElement){const n=e.dataset.lineType;if(n==="change-deletion")return"deletions";if(n==="change-addition"||n==="change-additions")return"additions"}const t=A.closest("[data-code]");return t instanceof HTMLElement&&t.hasAttribute("data-deletions")?"deletions":"additions"}function Nc(A,e){const t=e.dataset.lineIndex;if(!t)return;const n=t.split(",").map(i=>parseInt(i,10)).filter(i=>!Number.isNaN(i));if(n.length!==0)return A&&n.length===2?n[1]:n[0]}function aa(A,e,t,n){const i=Array.from(A.querySelectorAll(`[data-line="${t}"], [data-alt-line="${t}"]`)).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const r=n??"additions";for(const o of i)if(Zf(o)===r||parseInt(o.dataset.altLine??"",10)===t)return Nc(e,o)}function mE(A,e){if(!e)return e;if(!A)return;const t=A.querySelector("[data-diff]");if(!(t instanceof HTMLElement))return;const n=t.dataset.diffType==="split",i=aa(A,n,e.start,e.side),r=aa(A,n,e.end,e.endSide??e.side);if(i===void 0||r===void 0)return A.querySelector("[data-line], [data-alt-line]")==null?void 0:null;if(i<=r)return e;const o=e.endSide??e.side,s={start:e.end,end:e.start};return o&&(s.side=o),e.endSide&&e.side&&(s.endSide=e.side),s}function Xf(A){const e=A.dataset.lineAnnotation?.split(",")[1];if(!e)return;const t=parseInt(e,10);if(!Number.isNaN(t))return t}function A4(A){const e=Array.from(A.querySelectorAll("[data-comment-selected]"));for(const t of e)t instanceof HTMLElement&&t.removeAttribute("data-comment-selected")}function iq(A,e){A4(A);const t=A.querySelector("[data-diff]");if(!(t instanceof HTMLElement))return;const n=t.dataset.diffType==="split",i=Array.from(t.querySelectorAll("[data-line-index]")).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const r=Array.from(t.querySelectorAll("[data-line-annotation]")).filter(o=>o instanceof HTMLElement);for(const o of e){const s=aa(A,n,o.start,o.side);if(s===void 0)continue;const a=o.end===o.start&&(o.endSide==null||o.endSide===o.side)?s:aa(A,n,o.end,o.endSide??o.side);if(a===void 0)continue;const l=Math.min(s,a),c=Math.max(s,a);for(const g of i){const d=Nc(n,g);d===void 0||d<l||d>c||g.setAttribute("data-comment-selected","")}for(const g of r){const d=Xf(g);d===void 0||d<l||d>c||g.setAttribute("data-comment-selected","")}}}function rq(A,e){A4(A);const t=Array.from(A.querySelectorAll("[data-line-annotation]")).filter(n=>n instanceof HTMLElement);for(const n of e){const i=Math.max(1,Math.min(n.start,n.end)),r=Math.max(n.start,n.end);for(let o=i;o<=r;o++){const s=Array.from(A.querySelectorAll(`[data-line="${o}"], [data-column-number="${o}"]`));for(const a of s)a instanceof HTMLElement&&a.setAttribute("data-comment-selected","")}for(const o of t){const s=Xf(o);s===void 0||s<i||s>r||o.setAttribute("data-comment-selected","")}}}function oq(A,e){const t=new ResizeObserver(A);return DA(t.disconnect.bind(t)),{observe:n=>t.observe(n,e),unobserve:t.unobserve.bind(t)}}function e4(A,e,t){const n=new WeakMap,{observe:i,unobserve:r}=oq(o=>{for(const s of o){const{contentRect:a,target:l}=s,c=Math.round(a.width),g=Math.round(a.height),d=n.get(l);(!d||d.width!==c||d.height!==g)&&(e(a,l,s),n.set(l,{width:c,height:g}))}},t);iA(o=>{const s=UC(Ns(rA(A)));return TC(s,o,i,r),s},[])}const la=new Set;let $t,w1,wE=!1;function sq(A){return A instanceof HTMLElement?A.closest("[data-prevent-autofocus]")||A.isContentEditable?!0:/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(A.tagName):!1}function yE(A){if(A instanceof Node)for(const e of la){const t=e.element();if(t&&t.isConnected&&t.contains(A))return e}}function aq(){wE||typeof window>"u"||(wE=!0,window.addEventListener("keydown",A=>{if(A.defaultPrevented||sq(A.target)||!(A.metaKey||A.ctrlKey))return;const t=A.key.toLowerCase();if(t==="g"){const r=w1;if(!r||!r.isOpen())return;A.preventDefault(),A.stopPropagation(),r.next(A.shiftKey?-1:1);return}if(t!=="f")return;const n=w1;if(n&&n.isOpen()){A.preventDefault(),A.stopPropagation(),n.open();return}const i=yE(document.activeElement)??yE(A.target)??$t??Array.from(la)[0];i&&(A.preventDefault(),A.stopPropagation(),i.open())},{capture:!0}))}function ti(){const A=globalThis.CSS?.highlights;A&&(A.delete("opencode-find"),A.delete("opencode-find-current"))}function DE(){const A=globalThis;return typeof A.Highlight=="function"&&A.CSS?.highlights!=null}function kE(A){let e=A.parentElement;for(;e;){const t=getComputedStyle(e);if(t.overflowY==="auto"||t.overflowY==="scroll")return e;e=e.parentElement}}function lq(A){let e,t,n="overlay",i=[];const[r,o]=T([]),[s,a]=Pc({open:!1,query:"",index:0,count:0,pos:{top:8,right:8}}),l=()=>s.open,c=()=>s.query,g=()=>s.index,d=()=>s.count,Q=()=>s.pos,B=()=>{o([])},C=()=>{const S=A.overlay();S&&(t!==void 0&&(cancelAnimationFrame(t),t=void 0),S.innerHTML="")},I=()=>{if(n!=="overlay"){C();return}const S=A.wrapper(),G=A.overlay();if(!S||!G||(C(),i.length===0))return;const K=S.getBoundingClientRect(),q=g(),J=document.createDocumentFragment();for(let P=0;P<i.length;P++){const j=i[P],oA=P===q;for(const aA of Array.from(j.getClientRects())){if(!aA.width||!aA.height)continue;const z=document.createElement("div");z.style.position="absolute",z.style.left=`${Math.round(aA.left-K.left)}px`,z.style.top=`${Math.round(aA.top-K.top)}px`,z.style.width=`${Math.round(aA.width)}px`,z.style.height=`${Math.round(aA.height)}px`,z.style.borderRadius="2px",z.style.backgroundColor=oA?"var(--surface-warning-strong)":"var(--surface-warning-base)",z.style.opacity=oA?"0.55":"0.35",oA&&(z.style.boxShadow="inset 0 0 0 1px var(--border-warning-base)"),J.appendChild(z)}}G.appendChild(J)};function f(){n==="overlay"&&l()&&t===void 0&&(t=requestAnimationFrame(()=>{t=void 0,I()}))}const u=()=>{if(n!=="overlay")return;const S=A.getRoot(),G=S?Array.from(S.querySelectorAll("[data-code]")).filter(q=>q instanceof HTMLElement):[],K=r();G.length===K.length&&G.every((q,J)=>q===K[J])||(B(),o(G))},p=()=>{ti(),C(),B(),i=[],a("count",0),a("index",0)},w=()=>{if(typeof window>"u")return;const S=A.wrapper();if(!S)return;const G=kE(S)??S,K=G.getBoundingClientRect(),q=parseFloat(getComputedStyle(G).getPropertyValue("--session-title-height")),J=Number.isNaN(q)?0:q;a("pos",{top:Math.round(K.top)+J-4,right:Math.round(window.innerWidth-K.right)+8})},m=(S,G)=>{const K=G.toLowerCase(),q=[],J=Array.from(S.querySelectorAll("[data-content] [data-line], [data-column-content]")).filter(P=>P instanceof HTMLElement);for(const P of J){const j=P.textContent;if(!j)continue;const oA=j.toLowerCase();let aA=oA.indexOf(K);if(aA===-1)continue;const z=[],dA=[],sA=document.createTreeWalker(P,NodeFilter.SHOW_TEXT);let lA=sA.nextNode(),EA=0;for(;lA;)lA instanceof Text&&(EA+=lA.data.length,z.push(lA),dA.push(EA)),lA=sA.nextNode();if(z.length===0)continue;const CA=UA=>{let kA=0,bA=dA.length-1;for(;kA<bA;){const re=kA+bA>>1;dA[re]>=UA?bA=re:kA=re+1}const PA=kA===0?0:dA[kA-1];return{node:z[kA],offset:UA-PA}};for(;aA!==-1;){const UA=CA(aA),kA=CA(aA+G.length),bA=document.createRange();bA.setStart(UA.node,UA.offset),bA.setEnd(kA.node,kA.offset),q.push(bA),aA=oA.indexOf(K,aA+G.length)}}return q},y=S=>{const G=S.startContainer;(G instanceof Element?G:G.parentElement)?.scrollIntoView({block:"center",inline:"center"})},M=(S,G)=>{const K=globalThis.CSS?.highlights,q=globalThis.Highlight;if(!K||typeof q!="function")return!1;K.delete("opencode-find"),K.delete("opencode-find-current");const J=S[G];J&&K.set("opencode-find-current",new q(J));const P=S.filter((j,oA)=>oA!==G);return P.length>0&&K.set("opencode-find",new q(...P)),!0},v=S=>{if(!l())return;const G=c().trim();if(!G){p();return}const K=A.getRoot();if(!K)return;n=DE()?"highlights":"overlay";const q=m(K,G),J=q.length,P=S?.reset?0:g(),j=J?Math.min(P,J-1):0;i=q,a("count",J),a("index",j);const oA=q[j];if(n==="highlights"){C(),B(),M(q,j)||(n="overlay",ti(),u(),f()),S?.scroll&&oA&&y(oA);return}ti(),u(),S?.scroll&&oA&&y(oA),f()},N=()=>{a("open",!1),a("query",""),p(),w1===x&&(w1=void 0)},_=()=>{w1&&w1!==x&&w1.close(),w1=x,$t=x,l()||a("open",!0),requestAnimationFrame(()=>{v({scroll:!0}),e?.focus(),e?.select()})},F=S=>{if(!l())return;const G=d();if(G<=0)return;const K=(g()+S+G)%G;a("index",K);const q=i[K];if(q){if(n==="highlights"){if(!M(i,K)){n="overlay",v({reset:!0,scroll:!0});return}y(q);return}ti(),u(),y(q),f()}},x={element:A.wrapper,isOpen:()=>l(),next:F,open:_,close:N};return iA(()=>{for(const S of r())tn(S,"scroll",f,{passive:!0})}),F1(()=>{n=DE()?"highlights":"overlay",aq(),la.add(x),$t||($t=x),DA(()=>{la.delete(x),w1===x&&(w1=void 0,ti()),$t===x&&($t=void 0)})}),iA(()=>{if(!l())return;const S=()=>w();requestAnimationFrame(S),tn(window,"resize",S,{passive:!0});const G=A.wrapper();if(!G)return;const K=kE(G)??G;e4(K,S)}),DA(()=>{B(),C(),w1===x&&(w1=void 0,ti())}),{open:l,query:c,count:d,index:g,pos:Q,setInput:S=>{e=S},setQuery:S=>{a("query",S),a("index",0),v({reset:!0,scroll:!0})},focus:_,close:N,next:F,refresh:S=>v(S),onPointerDown:()=>{$t=x,A.wrapper()?.focus({preventScroll:!0})},onFocus:()=>{$t=x},onInputKeyDown:S=>{if(S.key==="Escape"){S.preventDefault(),N();return}S.key==="Enter"&&(S.preventDefault(),F(S.shiftKey?-1:1))}}}function gq(){return{token:0}}function yr(A){A.observer?.disconnect(),A.observer=void 0}function t4(A){if(!A)return;const e=A.querySelector("diffs-container");if(e instanceof HTMLElement)return e}function cq(A){return t4(A)?.shadowRoot??void 0}function Sc(A){if(!A||typeof document>"u")return;const e=document.documentElement.dataset.colorScheme;if(e==="dark"||e==="light"){A.dataset.colorScheme=e;return}A.removeAttribute("data-color-scheme")}function dq(A){if(typeof document>"u")return()=>{};if(Sc(A()),typeof MutationObserver>"u")return()=>{};const e=document.documentElement,t=new MutationObserver(()=>Sc(A()));return t.observe(e,{attributes:!0,attributeFilter:["data-color-scheme"]}),()=>t.disconnect()}function Qq(A){yr(A.state),A.state.token+=1;const e=A.state.token,t=Math.max(0,A.settleFrames??0),n=()=>{const o=s=>{if(e===A.state.token){if(s<=0){A.onReady();return}requestAnimationFrame(()=>o(s-1))}};requestAnimationFrame(()=>o(t))},i=o=>{if(A.isReady(o)){n();return}typeof MutationObserver>"u"||(yr(A.state),A.state.observer=new MutationObserver(()=>{e===A.state.token&&A.isReady(o)&&(yr(A.state),n())}),A.state.observer.observe(o,{childList:!0,subtree:!0}))},r=A.getRoot();if(!r){if(typeof MutationObserver>"u")return;A.state.observer=new MutationObserver(()=>{if(e!==A.state.token)return;const o=A.getRoot();o&&i(o)}),A.state.observer.observe(A.container,{childList:!0,subtree:!0});return}i(r)}function Bq(A){return A?A.start===A.end&&(A.endSide==null||A.endSide===A.side):!1}function Eq(A){if(A instanceof Range)return A;const e=new Range;return e.setStart(A.startContainer,A.startOffset),e.setEnd(A.endContainer,A.endOffset),e}function n4(A,e){!A||!e||requestAnimationFrame(()=>{const t=A.getSelection?.()??window.getSelection();if(t)try{t.removeAllRanges(),t.addRange(e)}catch{}})}function Cq(){let A="none",e,t=!1,n=!1;const i=()=>{A="none",e=void 0,t=!1};return{begin(r,o){if(!r){A="text";return}A="numbers",e=o,t=!1},track(r,o){return A!=="numbers"?!1:(r&1)===0?(i(),!0):(o!==void 0&&e!==void 0&&o!==e&&(t=!0),!0)},finish(){const r=A;return n=r==="numbers"&&t,i(),r},consume(r){const o=n&&!Bq(r);return n=!1,o},reset(){n=!1,i()}}}function Xa(A){if(A)return A instanceof HTMLElement?A:A.parentElement??void 0}function uq(A){const e=Xa(A);if(!e)return;const t=e.closest("[data-line]");if(!(t instanceof HTMLElement))return;const n=parseInt(t.dataset.line??"",10);if(!Number.isNaN(n))return n}function bE(A){const e=Xa(A);if(!e)return;const t=e.closest("[data-line], [data-alt-line]");if(!(t instanceof HTMLElement))return;const n=parseInt(t.dataset.line??"",10);if(!Number.isNaN(n))return n;const i=parseInt(t.dataset.altLine??"",10);if(!Number.isNaN(i))return i}function hq(A){const e=Xa(A);if(!e)return;const t=e.closest("[data-code]");if(t instanceof HTMLElement)return t.hasAttribute("data-deletions")?"deletions":"additions"}function i4(A){const e=A.root.getSelection?.()??window.getSelection();if(!e||e.isCollapsed)return;const t=e.getComposedRanges?.({shadowRoots:[A.root]})?.[0]??(e.rangeCount>0?e.getRangeAt(0):void 0),n=t?.startContainer??e.anchorNode,i=t?.endContainer??e.focusNode;if(!n||!i||!A.root.contains(n)||!A.root.contains(i))return;const r=A.lineForNode(n),o=A.lineForNode(i);if(r===void 0||o===void 0)return;const s=A.sideForNode?.(n),a=A.sideForNode?.(i),l=s??a,c={start:r,end:o};return l&&(c.side=l),a&&l&&a!==l&&(c.endSide=a),{range:c,text:A.preserveTextSelection&&t?Eq(t).cloneRange():void 0}}const ts=new WeakMap,Iq={lineHeight:24,hunkSeparatorHeight:24,spacing:0};function fq(A){return A==="auto"||A==="scroll"||A==="overlay"}function vE(A){let e=A.parentElement;for(;e;){const t=getComputedStyle(e);if(fq(t.overflowY))return e;e=e.parentElement}}function pq(A){if(typeof document>"u")return;const e=A.closest("[data-component='session-review']");if(e instanceof HTMLElement){const n=vE(A)??e,i=e.querySelector("[data-slot='session-review-container']");return{key:e,root:n,content:i instanceof HTMLElement?i:void 0}}const t=vE(A);if(t){const n=t.querySelector("[role='log']");return{key:t,root:t,content:n instanceof HTMLElement?n:void 0}}return{key:document,root:document,content:void 0}}function mq(A){const e=pq(A);if(!e)return;let t=ts.get(e.key);if(!t){const i=new $f;i.setup(e.root,e.content),t={virtualizer:i,refs:0},ts.set(e.key,t)}t.refs+=1;let n=!1;return{virtualizer:t.virtualizer,release(){if(n)return;n=!0;const i=ts.get(e.key);i&&(i.refs-=1,!(i.refs>0)&&(i.virtualizer.cleanUp(),ts.delete(e.key)))}}}function wq(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var lr={exports:{}},yq=lr.exports,ME;function Dq(){return ME||(ME=1,(function(A,e){(function(t,n){n(e)})(yq,function(t){const n=Symbol("newer"),i=Symbol("older");class r{constructor(g,d){typeof g!="number"&&(d=g,g=0),this.size=0,this.limit=g,this.oldest=this.newest=void 0,this._keymap=new Map,d&&(this.assign(d),g<1&&(this.limit=this.size))}_markEntryAsUsed(g){g!==this.newest&&(g[n]&&(g===this.oldest&&(this.oldest=g[n]),g[n][i]=g[i]),g[i]&&(g[i][n]=g[n]),g[n]=void 0,g[i]=this.newest,this.newest&&(this.newest[n]=g),this.newest=g)}assign(g){let d,Q=this.limit||Number.MAX_VALUE;this._keymap.clear();let B=g[Symbol.iterator]();for(let C=B.next();!C.done;C=B.next()){let I=new o(C.value[0],C.value[1]);if(this._keymap.set(I.key,I),d?(d[n]=I,I[i]=d):this.oldest=I,d=I,Q--==0)throw new Error("overflow")}this.newest=d,this.size=this._keymap.size}get(g){var d=this._keymap.get(g);return d?(this._markEntryAsUsed(d),d.value):void 0}set(g,d){var Q=this._keymap.get(g);return Q?(Q.value=d,this._markEntryAsUsed(Q),this):(this._keymap.set(g,Q=new o(g,d)),this.newest?(this.newest[n]=Q,Q[i]=this.newest):this.oldest=Q,this.newest=Q,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var g=this.oldest;if(g)return this.oldest[n]?(this.oldest=this.oldest[n],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),g[n]=g[i]=void 0,this._keymap.delete(g.key),--this.size,[g.key,g.value]}find(g){let d=this._keymap.get(g);return d?d.value:void 0}has(g){return this._keymap.has(g)}delete(g){var d=this._keymap.get(g);return d?(this._keymap.delete(d.key),d[n]&&d[i]?(d[i][n]=d[n],d[n][i]=d[i]):d[n]?(d[n][i]=void 0,this.oldest=d[n]):d[i]?(d[i][n]=void 0,this.newest=d[i]):this.oldest=this.newest=void 0,this.size--,d.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new a(this.oldest)}values(){return new l(this.oldest)}entries(){return this}[Symbol.iterator](){return new s(this.oldest)}forEach(g,d){typeof d!="object"&&(d=this);let Q=this.oldest;for(;Q;)g.call(d,Q.value,Q.key,this),Q=Q[n]}toJSON(){for(var g=new Array(this.size),d=0,Q=this.oldest;Q;)g[d++]={key:Q.key,value:Q.value},Q=Q[n];return g}toString(){for(var g="",d=this.oldest;d;)g+=String(d.key)+":"+d.value,d=d[n],d&&(g+=" < ");return g}}t.LRUMap=r;function o(c,g){this.key=c,this.value=g,this[n]=void 0,this[i]=void 0}function s(c){this.entry=c}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:[c.key,c.value]}):{done:!0,value:void 0}};function a(c){this.entry=c}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:c.key}):{done:!0,value:void 0}};function l(c){this.entry=c}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:c.value}):{done:!0,value:void 0}}})})(lr,lr.exports)),lr.exports}var kq=Dq();const NE=wq(kq),ns=Symbol("IGNORE_RESPONSE");var Bg=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},bq=class{highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(A,{langs:e,theme:t=Ce,useTokenTransformer:n=!1,lineDiffType:i="word-alt",maxLineDiffLength:r=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:s="shiki-js"}){this.options=A,this.preferredHighlighter=s,this.renderOptions={theme:t,useTokenTransformer:n,lineDiffType:i,maxLineDiffLength:r,tokenizeMaxLineLength:o},this.fileCache=new NE.LRUMap(A.totalASTLRUCacheSize??100),this.diffCache=new NE.LRUMap(A.totalASTLRUCacheSize??100),this.queueInitialization(e)}isWorkingPool(){return!this.workersFailed}getFileResultCache(A){return A.cacheKey!=null?this.fileCache.get(A.cacheKey):void 0}getDiffResultCache(A){return A.cacheKey!=null?this.diffCache.get(A.cacheKey):void 0}inspectCaches(){const{fileCache:A,diffCache:e}=this;return{fileCache:A,diffCache:e}}evictFileFromCache(A){try{return this.fileCache.delete(A)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(A){try{return this.diffCache.delete(A)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:A=this.renderOptions.theme??Ce,useTokenTransformer:e=this.renderOptions.useTokenTransformer??!1,lineDiffType:t=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:n=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:i=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:r}=this,o=++this.renderOptionsRequestVersion,s=()=>this.isCurrentLifecycle(r)&&this.renderOptionsRequestVersion===o;try{const a={theme:A,useTokenTransformer:e,lineDiffType:t,maxLineDiffLength:n,tokenizeMaxLineLength:i};if(this.isInitialized()||await this.initialize(),!s()||Ft(a,this.renderOptions))return;const l=zr(A);let c=[];if(_i(a.theme,this.renderOptions.theme)||(yc(l)?c=IE(l):c=await fE(l)),!s())return;if(this.highlighter!=null)wc(c,this.highlighter);else{const d=await ea({themes:l,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!s())return;this.highlighter=d}const g=this.setRenderOptionsOnWorkers(a,c);this.renderOptions=a,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const d of this.themeSubscribers)d.onThemeChange();await g}catch(a){if(a instanceof Bg||!s())return;throw a}}getFileRenderOptions(){const{tokenizeMaxLineLength:A,theme:e,useTokenTransformer:t}=this.renderOptions;return{theme:e,useTokenTransformer:t,tokenizeMaxLineLength:A}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(A,e){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const t=[];for(const n of this.workers){if(!n.initialized)throw console.log({managedWorker:n}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");t.push(new Promise((i,r)=>{const o=this.generateRequestId(),s={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:A,resolvedThemes:e},resolve:i,reject:r,requestStart:Date.now()};this.activeTaskById.set(o,s),n.pendingSetupRequestId=o,n.worker.postMessage(s.request)}))}await Promise.all(t)}subscribeToThemeChanges(A){return this.themeSubscribers.add(A),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(A),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(A){this.themeSubscribers.delete(A),this.queueBroadcastStateChanges()}subscribeToStatChanges(A){return this.statSubscribers.add(A),A(this.getStats()),()=>{this.statSubscribers.delete(A)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const A=this.getStats();for(const e of this.statSubscribers)e(A)};cleanUpTasks(A){this.detachInstanceFromQueuedTasks(A);const e=this.activeRequestByInstance.get(A);if(e!=null){const t=this.activeTaskById.get(e);En(t)?(this.detachInstanceFromRenderTask(t,A),!t.primeCache&&t.instances.size===0&&this.removeActiveTask(t)):this.activeTaskById.delete(e)}this.activeRequestByInstance.delete(A),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(A=[]){if(this.initialized!==!0)if(this.initialized===!1){const{lifecycleGeneration:e}=this;this.initialized=new Promise((t,n)=>{(async()=>{try{const i=zr(this.renderOptions.theme);let r=[];if(yc(i)?r=IE(i):r=await fE(i),!this.isCurrentLifecycle(e)){t();return}let o=[];if(uE(A)?o=CE(A):o=await hE(A),!this.isCurrentLifecycle(e)){t();return}const[s]=await Promise.all([ea({themes:i,langs:["text",...A],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(r,o)]);if(!this.isCurrentLifecycle(e)){this.terminateWorkers(),t();return}this.highlighter=s,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),t()}catch(i){if(i instanceof Bg||!this.isCurrentLifecycle(e)){t();return}this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),n(i)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(A,e){this.workersFailed=!1;const t=[],n=void 0;this.workers.length>0&&this.terminateWorkers();for(let i=0;i<(this.options.poolSize??8);i++){const r=this.options.workerFactory(),o={worker:r,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...e.map(({name:s})=>s)]),customExtensionsVersion:0};r.addEventListener("message",s=>{this.handleWorkerMessage(o,s.data)}),r.addEventListener("error",s=>console.error("Worker error:",s,o)),this.workers.push(o),t.push(new Promise((s,a)=>{const l=this.generateRequestId(),c={type:"initialize",id:l,request:{type:"initialize",id:l,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:A,resolvedLanguages:e,customExtensionsVersion:void 0,customExtensionMap:n},resolve(){o.initialized=!0,s()},reject:a,requestStart:Date.now()};this.activeTaskById.set(l,c),this.executeTask(o,c)}))}await Promise.all(t)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let A=0;A<this.queuedTasks.length;){const e=this.queuedTasks[A];if(this.hasActiveRequest(e)){A++;continue}const t=SE(e),n=this.getAvailableWorker(t);if(n==null)break;this.queuedTasks.splice(A,1),this.assignWorkerToTask(e,n),this.resolveLanguagesAndExecuteTask(n,e,t)}this.queueBroadcastStateChanges()}};highlightFileAST(A,e){const t=this.getFileResultCache(e);$r(e)||t!=null&&An(t.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(A,e)||this.submitTask(A,{type:"file",file:e})}primeFileHighlightCache(A){if(A.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${A.name}".`);return}const e=this.getFileResultCache(A),t=this.getFileHighlightKey(A);if(t==null||$r(A)||e!=null&&An(e.options,this.getFileRenderOptions()))return;const n=this.getTaskByHighlightKey(t);n!=null?n.primeCache=!0:this.submitCacheTask({type:"file",file:A},t)}getPlainFileAST(A,e,t,n){if(this.highlighter==null){this.queueInitialization();return}return Df(A,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:e,totalLines:t,lines:n})}highlightDiffAST(A,e){const t=this.getDiffResultCache(e);Ao(e)||t!=null&&Ft(t.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(A,e)||this.submitTask(A,{type:"diff",diff:e})}primeDiffHighlightCache(A){if(A.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${A.prevName??A.name}" -> "${A.name}".`);return}const e=this.getDiffResultCache(A),t=this.getDiffHighlightKey(A);if(t==null||Ao(A)||e!=null&&Ft(e.options,this.getDiffRenderOptions()))return;const n=this.getTaskByHighlightKey(t);n!=null?n.primeCache=!0:this.submitCacheTask({type:"diff",diff:A},t)}getPlainDiffAST(A,e,t,n,i){return this.highlighter!=null?jf(A,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:e,totalLines:t,expandedHunks:n,collapsedContextThreshold:i}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(A){return this.lifecycleGeneration===A}queueInitialization(A){this.initialize(A).catch(e=>{console.error(e)})}cancelActiveWorkerTasks(){const A=new Bg;for(const e of this.activeTaskById.values())"reject"in e&&e.reject(A)}terminateWorkers(){for(const A of this.workers)A.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(A=>A.requestId!=null||A.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(A,e){this.initialized===!1&&this.queueInitialization();const t=this.getHighlightKeyForRequest(e),n=t!=null?this.getTaskByHighlightKey(t):void 0;if(n!=null){this.detachInstanceFromQueuedTasks(A,n),this.addInstanceToTask(n,A),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(A);const i=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:o}=this,s=(()=>{switch(e.type){case"file":return{type:"file",id:i,request:{...e,id:i},instances:new Set([A]),primeCache:!1,highlightKey:t,renderOptionsVersion:o,requestStart:r};case"diff":return{type:"diff",id:i,request:{...e,id:i},instances:new Set([A]),primeCache:!1,highlightKey:t,renderOptionsVersion:o,requestStart:r}}})();this.enqueueRenderTask(s,A)}submitCacheTask(A,e){this.initialized===!1&&this.queueInitialization();const t=this.generateRequestId(),n=Date.now(),{renderOptionsVersion:i}=this,r=(()=>{switch(A.type){case"file":return{type:"file",id:t,request:{...A,id:t},instances:new Set,primeCache:!0,highlightKey:e,renderOptionsVersion:i,requestStart:n};case"diff":return{type:"diff",id:t,request:{...A,id:t},instances:new Set,primeCache:!0,highlightKey:e,renderOptionsVersion:i,requestStart:n}}})();this.enqueueRenderTask(r)}enqueueRenderTask(A,e){this.queuedTasks.push(A),e!=null&&this.queuedTaskByInstance.set(e,A),A.highlightKey!=null&&this.taskByHighlightKey.set(A.highlightKey,A),this.queueDrain()}async resolveLanguagesAndExecuteTask(A,e,t){try{const n=t.filter(i=>!A.langs.has(i));if(n.length>0&&(uE(n)?e.request.resolvedLanguages=CE(n):e.request.resolvedLanguages=await hE(n)),!this.activeTaskById.has(e.id)){A.requestId===e.id&&(this.cleanWorkerAndTask(A,e),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(A,e)}catch{this.cleanWorkerAndTask(A,e),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(A,e){const t=this.activeTaskById.get(e.id);try{if(t==null)throw ns;if(e.type==="error"){const n=new Error(e.error);if(e.stack&&(n.stack=e.stack),"reject"in t)t.reject(n);else if(En(t))this.notifyHighlightError(t,n);else throw new Error("handleWorkerMessage: unknown task type");throw n}else switch(e.requestType){case"initialize":if(t.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");this.syncCustomExtensionVersion(A,t.request),t.resolve();break;case"set-render-options":if(t.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");t.resolve();break;case"file":{if(t.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:n,options:i}=e;if(!this.isCurrentRenderTask(t)||!An(i,this.getFileRenderOptions()))throw ns;const{request:r}=t;this.syncCustomExtensionVersion(A,r),r.file.cacheKey!=null&&this.fileCache.set(r.file.cacheKey,{result:n,options:i}),this.notifyFileInstances(t,n,i);break}case"diff":{if(t.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:n,options:i}=e;if(!this.isCurrentRenderTask(t)||!Ft(i,this.getDiffRenderOptions()))throw ns;const{request:r}=t;this.syncCustomExtensionVersion(A,r),r.diff.cacheKey!=null&&this.diffCache.set(r.diff.cacheKey,{result:n,options:i}),this.notifyDiffInstances(t,n,i);break}}}catch(n){n!==ns&&console.error(n,t,e)}this.cleanWorkerAndTask(A,t,e.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(A,e){e.requestId=A.id,En(A)&&(this.clearQueuedInstanceRequests(A),this.trackInstanceRequests(A)),this.activeTaskById.set(A.id,A)}cleanWorkerAndTask(A,e,t=e?.id){A.requestId===t&&(A.requestId=void 0),A.pendingSetupRequestId===t&&(A.pendingSetupRequestId=void 0),e!=null&&(En(e)&&(this.clearInstanceRequests(e),this.clearHighlightKey(e)),this.activeTaskById.delete(e.id))}executeTask(A,e){vq(e.request)&&this.maybeAttachCustomExtensions(A,e.request),this.activeTaskById.has(e.id)||this.assignWorkerToTask(e,A);for(const t of SE(e))A.langs.add(t);try{A.worker.postMessage(e.request)}catch(t){console.error("Failed to post message to worker:",t),En(e)?this.notifyHighlightError(e,t):"reject"in e&&e.reject(t),this.cleanWorkerAndTask(A,e),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(A,e){if(e.customExtensionsVersion!=null)return;const t=aO();A.customExtensionsVersion>=t||(e.customExtensionsVersion=t,e.customExtensionMap=lO())}syncCustomExtensionVersion(A,e){e.customExtensionsVersion!=null&&(A.customExtensionsVersion=e.customExtensionsVersion)}getAvailableWorker(A){let e;for(const t of this.workers){if(t.requestId!=null||t.pendingSetupRequestId!=null||!t.initialized)continue;if(e=t,A.length===0)break;let n=!0;for(const i of A)if(!t.langs.has(i)){n=!1;break}if(n)break}return e}getFileHighlightKey(A){if(A.cacheKey!=null)return`file:${A.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(A){if(A.cacheKey!=null)return`diff:${A.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(A){switch(A.type){case"file":return this.getFileHighlightKey(A.file);case"diff":return this.getDiffHighlightKey(A.diff)}}hasActiveRequest(A){for(const e of Zi(A))if(this.activeRequestByInstance.has(e))return!0;return!1}addInstanceToTask(A,e){A.type,A.instances.add(e),this.activeTaskById.has(A.id)?this.activeRequestByInstance.set(e,A.id):this.queuedTaskByInstance.set(e,A)}detachInstanceFromQueuedTasks(A,e){const t=this.queuedTaskByInstance.get(A);t==null||t===e||(this.queuedTaskByInstance.delete(A),this.detachInstanceFromRenderTask(t,A),!t.primeCache&&t.instances.size===0&&this.removeQueuedTask(t))}detachInstanceFromRenderTask(A,e){A.type,A.instances.delete(e)}removeQueuedTask(A){const e=this.queuedTasks.indexOf(A);e!==-1&&this.queuedTasks.splice(e,1),this.clearQueuedInstanceRequests(A),this.clearHighlightKey(A)}removeActiveTask(A){this.clearInstanceRequests(A),this.clearHighlightKey(A),this.activeTaskById.delete(A.id)}invalidateRenderTasks(){for(let A=this.queuedTasks.length-1;A>=0;A--){const e=this.queuedTasks[A];e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(e)}for(const A of Array.from(this.activeTaskById.values()))En(A)&&A.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(A)}clearQueuedInstanceRequests(A){for(const e of Zi(A))this.queuedTaskByInstance.get(e)===A&&this.queuedTaskByInstance.delete(e)}clearHighlightKey(A){A.highlightKey!=null&&this.taskByHighlightKey.get(A.highlightKey)===A&&this.taskByHighlightKey.delete(A.highlightKey)}trackInstanceRequests(A){for(const e of Zi(A))this.activeRequestByInstance.set(e,A.id)}clearInstanceRequests(A){for(const e of Zi(A))this.activeRequestByInstance.get(e)===A.id&&this.activeRequestByInstance.delete(e)}notifyFileInstances(A,e,t){for(const n of A.instances)this.activeRequestByInstance.get(n)===A.id&&n.onHighlightSuccess(A.request.file,e,t)}notifyDiffInstances(A,e,t){for(const n of A.instances)this.activeRequestByInstance.get(n)===A.id&&n.onHighlightSuccess(A.request.diff,e,t)}notifyHighlightError(A,e){for(const t of Zi(A))this.activeRequestByInstance.get(t)===A.id&&t.onHighlightError(e)}hasMatchingFileInstanceTask(A,e){for(const t of this.iterateRenderTasks())if(t.type==="file"&&this.isCurrentRenderTask(t)&&t.instances.has(A)&&Ct(e,t.request.file))return!0;return!1}hasMatchingDiffInstanceTask(A,e){for(const t of this.iterateRenderTasks())if(t.type==="diff"&&this.isCurrentRenderTask(t)&&t.instances.has(A)&&Qi(t.request.diff,e))return!0;return!1}getTaskByHighlightKey(A){const e=this.taskByHighlightKey.get(A);return e!=null&&this.isCurrentRenderTask(e)?e:void 0}isCurrentRenderTask(A){return A.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(const A of this.queuedTasks)yield A;for(const A of this.activeTaskById.values())En(A)&&(yield A)}generateRequestId(){return`req_${++this.nextRequestId}`}};function vq(A){return A.type==="initialize"||A.type==="file"||A.type==="diff"}function SE(A){const e=new Set;if(A.type==="initialize"||A.type==="set-render-options")return[];switch(A.type){case"file":e.add(A.request.file.lang??Ye(A.request.file.name));break;case"diff":e.add(A.request.diff.lang??Ye(A.request.diff.name)),e.add(A.request.diff.lang??Ye(A.request.diff.prevName??"-"));break}return e.delete("text"),Array.from(e)}function En(A){return A?.type==="file"||A?.type==="diff"}function Zi(A){return A.instances}const Mq="/console/assets/worker-BVEmEyu5.js";tq();function Nq(){return new Worker(Mq,{type:"module"})}function xE(A){const e=new bq({workerFactory:Nq,poolSize:2},{theme:sa,lineDiffType:A,preferredHighlighter:"shiki-wasm"});return e.initialize(),e}let Eg,Cg;function ga(A){if(!(typeof window>"u"))return A==="split"?(Cg||(Cg=xE("word-alt")),Cg):(Eg||(Eg=xE("none")),Eg)}var Sq=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),xq=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Lq(A){if(Intl.Locale){const t=new Intl.Locale(A).maximize().script??"";return Sq.has(t)}const e=A.split("-")[0];return xq.has(e)}function _q(A){return Lq(A)?"rtl":"ltr"}function r4(){let A=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([A])}catch{A="en-US"}return{locale:A,direction:_q(A)}}var xc=r4(),gr=new Set;function LE(){xc=r4();for(const A of gr)A(xc)}function Fq(){const[A,e]=T(xc),t=R(()=>A());return F1(()=>{gr.size===0&&window.addEventListener("languagechange",LE),gr.add(e),DA(()=>{gr.delete(e),gr.size===0&&window.removeEventListener("languagechange",LE)})}),{locale:()=>t().locale,direction:()=>t().direction}}var Gq=A1();function o4(){const A=Fq();return Pe(Gq)||A}var ug=new Map;function Rq(A){const{locale:e}=o4(),t=R(()=>e()+(A?Object.entries(A).sort((n,i)=>n[0]<i[0]?-1:1).join():""));return R(()=>{const n=t();let i;return ug.has(n)&&(i=ug.get(n)),i||(i=new Intl.Collator(e(),A),ug.set(n,i)),i})}const Uq={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.git":"Git changes","ui.sessionReview.title.branch":"Branch changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReviewV2.expandMode":"Expand or collapse diff","ui.sessionReviewV2.filterFiles":"Filter files","ui.sessionReviewV2.toggleSidebar":"Toggle file tree","ui.sessionReviewV2.showAllLines":"Show all lines","ui.sessionReviewV2.hideNonDiffLines":"Hide non-diff lines","ui.sessionReviewV2.unifiedDiff":"Unified diff","ui.sessionReviewV2.splitDiff":"Split diff","ui.sessionReviewV2.previousFile":"Previous file","ui.sessionReviewV2.nextFile":"Next file","ui.sessionReviewV2.diffView":"Diff view","ui.sessionReviewV2.empty.noGit.title":"No tracked changes","ui.sessionReviewV2.empty.noGit.description":"Track, review, and undo changes in this project","ui.sessionReviewV2.empty.noGit.action":"Create Git repository","ui.sessionReviewV2.empty.noGit.actionLoading":"Creating Git repository...","ui.sessionReviewV2.empty.changes.title":"No file changes yet","ui.sessionReviewV2.empty.changes.description":"Project changes will appear here","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.contextPlaceholder":"Add context for this change","ui.lineComment.submit":"Comment","ui.lineComment.cancel":"Cancel","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.diffs.changed.one":"{{count}} Changed file","ui.sessionTurn.diffs.changed.other":"{{count}} Changed files","ui.sessionTurn.diffs.showAll":"Show all","ui.sessionTurn.diffs.showLess":"Show less","ui.sessionTurn.diffs.more":"+{{count}} more files","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addCredits":"Add credits","dialog.usageExceeded.freeTier.title":"Free limit reached","dialog.usageExceeded.freeTier.description":"Subscribe to Kilo Go for reliable access to the best open-source models, starting at $5/month.","dialog.usageExceeded.freeTier.actionLabel":"Subscribe","dialog.usageExceeded.accountRateLimit.title":"Go limit reached","dialog.usageExceeded.accountRateLimit.description":"Usage limit reached. To continue using this model now, enable usage from your available balance","dialog.usageExceeded.accountRateLimit.actionLabel":"Open settings","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.delegatingWaitingPermission":"Subagent waiting for permission","ui.sessionTurn.status.delegatingWaitingQuestion":"Subagent waiting for response","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.messagePart.mcp.input":"Input","ui.messagePart.mcp.output":"Output","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.promptInput.noMatchingItems":"No matching items","ui.promptInput.commands":"Commands","ui.promptInput.dropFiles":"Drop files to attach","ui.promptInput.removeAttachment":"Remove attachment","ui.promptInput.label":"Prompt","ui.promptInput.placeholder.shell":"Enter shell command...","ui.promptInput.placeholder.normal":"Ask anything, {{slash}} for commands, {{at}} for context...","ui.promptInput.add":"Add images and files","ui.promptInput.attachments":"Images and files","ui.promptInput.context":"Context","ui.promptInput.shell":"Shell command","ui.promptInput.chooseAgent":"Choose agent","ui.promptInput.chooseModel":"Choose model","ui.promptInput.chooseVariant":"Choose model variant","ui.promptInput.send":"Send","ui.promptInput.stop":"Stop","ui.tabs.close":"Close tab","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.mermaid.rendering":"Rendering Mermaid diagram...","ui.mermaid.renderError":"Mermaid render failed: {{message}}","ui.mermaid.errorDefault":"Unable to render Mermaid diagram.","ui.mermaid.errorEmpty":"Mermaid rendered an empty diagram.","ui.mermaid.download":"Download","ui.mermaid.copySource":"Copy Mermaid source","ui.mermaid.copySvg":"Copy SVG","ui.mermaid.copyPng":"Copy PNG","ui.mermaid.downloadSvg":"Download SVG","ui.mermaid.downloadPng":"Download PNG","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.swePruned":"SWE-Pruner · kept {{kept}} of {{total}} lines","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.websearch.provider":"{{provider}} Web Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.questions.numbered":"Questions {{number}}","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.clear":"Clear","ui.common.file":"File","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.common.showMore":"Show more","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.deleteQueued":"Delete queued message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert to here","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.question.subtitle.answered":"{{count}} answered","ui.question.subtitle.dismissed":"{{count}} dismissed","ui.question.answer.none":"(no answer)","ui.question.answer.dismissed":"Dismissed","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."},Xi=new Map;function Tq(A,e){const t=Xi.get(A);if(t)return t.select(e);const n=new Intl.PluralRules(A);return Xi.size>=32&&Xi.delete(Xi.keys().next().value),Xi.set(A,n),n.select(e)}function Oq(A,e){return`${A}.${e}`}function Kq(A,e){return e?A.replace(/{{\s*([^}]+?)\s*}}/g,(t,n)=>{const i=String(n),r=e[i];return r===void 0?"":String(r)}):A}const Lc={locale:()=>"en",t:(A,e)=>{const t=Uq[A]??String(A);return Kq(t,e)},plural:(A,e,t)=>Lc.t(Oq(A,Tq(Lc.locale(),e)),{...t,count:e})},qq=A1(Lc);function Al(){return Pe(qq)}const Jq=new Set(["png","jpg","jpeg","gif","webp","avif","bmp","ico","tif","tiff","heic"]),Hq=new Set(["mp3","wav","ogg","m4a","aac","flac","opus"]);function el(A){if(!(!A||typeof A!="object"))return A}function $0(A){if(!A)return;const e=A.split(";",1)[0]?.trim().toLowerCase();if(e)return e==="audio/x-aac"?"audio/aac":e==="audio/x-m4a"?"audio/mp4":e}function Yq(A){if(!A)return"";const e=A.lastIndexOf(".");return e===-1?"":A.slice(e+1).toLowerCase()}function Pq(A){const e=Yq(A);if(e==="svg")return"svg";if(Jq.has(e))return"image";if(Hq.has(e))return"audio"}function Vq(A){return el(A)?.type==="binary"}function jq(A,e){if(e==="svg")return A.startsWith("data:image/svg+xml")?A:void 0;if(e==="image")return A.startsWith("data:image/")?A:void 0;if(A.startsWith("data:audio/x-aac;"))return A.replace("data:audio/x-aac;","data:audio/aac;");if(A.startsWith("data:audio/x-m4a;"))return A.replace("data:audio/x-m4a;","data:audio/mp4;");if(A.startsWith("data:audio/"))return A}function hg(A,e){if(!A)return;if(typeof A=="string")return jq(A,e);const t=el(A);if(!t||typeof t.content!="string")return;const n=$0(typeof t.mimeType=="string"?t.mimeType:void 0);if(n){if(e==="svg")return n!=="image/svg+xml"?void 0:t.encoding==="base64"?`data:image/svg+xml;base64,${t.content}`:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t.content)}`;if(!(e==="image"&&!n.startsWith("image/"))&&!(e==="audio"&&!n.startsWith("audio/"))&&t.encoding==="base64")return`data:${n};base64,${t.content}`}}function zq(A){if(typeof atob=="function")try{const e=atob(A),t=Uint8Array.from(e,n=>n.charCodeAt(0));return typeof TextDecoder=="function"?new TextDecoder().decode(t):e}catch{}}function $q(A){const e=el(A);if(!(!e||typeof e.content!="string"||$0(typeof e.mimeType=="string"?e.mimeType:void 0)!=="image/svg+xml"))return e.encoding==="base64"?zq(e.content):e.content}function Ig(A){if(typeof A=="string")return A.length>0;const e=el(A);return e?typeof e.content=="string"&&e.content.length>0:!1}var Wq=k('<div class="flex min-h-56 flex-col items-center justify-center gap-2 px-6 py-10 text-center"><div class="text-14-semibold text-text-strong"></div><div class="text-14-regular text-text-weak">'),is=k('<div class="flex min-h-40 items-center justify-center px-6 py-4 text-center text-text-weak">'),Zq=k('<div class="flex justify-center bg-background-stronger px-6 py-4"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">'),Xq=k('<div class="flex justify-center bg-background-stronger px-6 py-4"><audio class="w-full max-w-xl"controls preload=metadata><source>'),AJ=k('<div class="flex flex-col gap-4 px-6 py-4">'),eJ=k('<div class="flex justify-center"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">');function tJ(A,e){return A.current!==void 0?A.current:A.after??A.before}function _E(A){const e=Al(),t=()=>A.media,n=R(()=>{const u=t();if(!(!u||u.mode==="off"))return Pq(u.path)}),i=R(()=>{const u=t();return!u||u.mode==="off"||n()?!1:Vq(u.current)}),r=()=>A.media?.onLoad?.(),o=R(()=>{const u=t(),p=n();return!u||!p?!1:u.deleted?!0:p==="svg"||u.current!==void 0?!1:!Ig(u.after)&&Ig(u.before)}),s=R(()=>{const u=t(),p=n();if(!(!u||p!=="image"&&p!=="audio"))return hg(tJ(u,p),p)}),a=R(()=>{const u=t(),p=n();if(!(!u||p!=="image"&&p!=="audio")&&u.current===void 0&&!o()&&!s()&&!(!u.path||!u.readFile))return{key:`${p}:${u.path}`,kind:p,path:u.path,readFile:u.readFile,onError:u.onError}}),[l]=et(a,async u=>u.readFile(u.path).then(p=>{const w=hg(p,u.kind);return w?{key:u.key,src:w,mime:u.kind==="audio"?$0(p?.mimeType):void 0}:(u.onError?.({kind:u.kind}),{key:u.key,error:!0})},()=>(u.onError?.({kind:u.kind}),{key:u.key,error:!0}))),c=R(()=>{const u=a(),p=l();if(!(!u||!p||p.key!==u.key))return p}),g=R(()=>{const u=c();return s()??(u&&"src"in u?u.src:void 0)}),d=R(()=>s()?"ready":a()?l.loading?"loading":c()?.error?"error":g()?"ready":"idle":"idle"),Q=R(()=>{const u=c();return u&&"mime"in u?u.mime:void 0}),B=R(()=>{const u=t();if(!(!u||n()!=="svg"))return $q(u.current)}),C=R(()=>{const u=t();if(!(!u||n()!=="svg"))return hg(u.current,"svg")}),I=R(()=>{const u=t();if(!(!u||n()!=="svg")&&B()===void 0&&Ig(u.current))return[u.path,u.current]});iA(B1(I,u=>{u&&t()?.onError?.({kind:"svg"})},{defer:!0}));const f=u=>e.t(u==="image"?"ui.fileMedia.kind.image":"ui.fileMedia.kind.audio");return E(Mr,{get children(){return[E(Te,{get when(){return n()==="image"||n()==="audio"},get children(){return E(H,{get when(){return g()},get fallback(){const u=t(),p=n();if(!u||p!=="image"&&p!=="audio")return A.fallback();const w=f(p);return o()?(()=>{var m=is();return h(m,()=>e.t("ui.fileMedia.state.removed",{kind:w})),m})():d()==="loading"?(()=>{var m=is();return h(m,()=>e.t("ui.fileMedia.state.loading",{kind:w})),m})():d()==="error"?(()=>{var m=is();return h(m,()=>e.t("ui.fileMedia.state.error",{kind:w})),m})():(()=>{var m=is();return h(m,()=>e.t("ui.fileMedia.state.unavailable",{kind:w})),m})()},children:u=>{const p=n();return p!=="image"&&p!=="audio"?A.fallback():p==="image"?(()=>{var w=Zq(),m=w.firstChild;return m.addEventListener("load",r),Y(y=>{var M=u(),v=t()?.path;return M!==y.e&&V(m,"src",y.e=M),v!==y.t&&V(m,"alt",y.t=v),y},{e:void 0,t:void 0}),w})():(()=>{var w=Xq(),m=w.firstChild,y=m.firstChild;return m.addEventListener("loadedmetadata",r),Y(M=>{var v=u(),N=Q();return v!==M.e&&V(y,"src",M.e=v),N!==M.t&&V(y,"type",M.t=N),M},{e:void 0,t:void 0}),w})()}})}}),E(Te,{get when(){return n()==="svg"},get children(){return B()===void 0&&C()==null?A.fallback():(()=>{var u=AJ();return h(u,E(H,{get when(){return B()!==void 0},get children(){return A.fallback()}}),null),h(u,E(H,{get when(){return C()},children:p=>(()=>{var w=eJ(),m=w.firstChild;return m.addEventListener("load",r),Y(y=>{var M=p(),v=t()?.path;return M!==y.e&&V(m,"src",y.e=M),v!==y.t&&V(m,"alt",y.t=v),y},{e:void 0,t:void 0}),w})()}),null),u})()}}),E(Te,{get when(){return i()},get children(){var u=Wq(),p=u.firstChild,w=p.nextSibling;return h(p,()=>t()?.path?.split("/").pop()??e.t("ui.fileMedia.binary.title")),h(w,()=>{const m=t()?.path;return m?e.t("ui.fileMedia.binary.description.path",{path:m}):e.t("ui.fileMedia.binary.description.default")}),u}}),E(Te,{when:!0,get children(){return A.fallback()}})]}})}var nJ=k('<div class="fixed z-50 flex h-8 items-center gap-2 rounded-md border border-border-base bg-background-base px-3 shadow-md"><input class="w-40 bg-transparent outline-none text-14-regular text-text-strong placeholder:text-text-weak"><div class="shrink-0 text-12-regular text-text-weak tabular-nums text-right"style=width:10ch></div><div class="flex items-center"><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong disabled:opacity-40 disabled:pointer-events-none"></button><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong disabled:opacity-40 disabled:pointer-events-none"></button></div><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong">');function iJ(A){const e=Al();return E(pC,{get children(){var t=nJ(),n=t.firstChild,i=n.nextSibling,r=i.nextSibling,o=r.firstChild,s=o.nextSibling,a=r.nextSibling;t.$$pointerdown=c=>c.stopPropagation(),h(t,E(ai,{name:"magnifying-glass",size:"small",class:"text-text-weak shrink-0"}),n),n.$$keydown=c=>A.onKeyDown(c),n.$$input=c=>A.onInput(c.currentTarget.value);var l=A.setInput;return typeof l=="function"?Xe(l,n):A.setInput=n,h(i,(()=>{var c=IA(()=>!!A.count());return()=>c()?`${A.index()+1}/${A.count()}`:"0/0"})()),zA(o,"click",A.onPrev,!0),h(o,E(ai,{name:"chevron-down",size:"small",class:"rotate-180"})),zA(s,"click",A.onNext,!0),h(s,E(ai,{name:"chevron-down",size:"small"})),zA(a,"click",A.onClose,!0),h(a,E(ai,{name:"close-small",size:"small"})),Y(c=>{var g=`${A.pos().top}px`,d=`${A.pos().right}px`,Q=e.t("ui.fileSearch.placeholder"),B=A.count()===0,C=e.t("ui.fileSearch.previousMatch"),I=A.count()===0,f=e.t("ui.fileSearch.nextMatch"),u=e.t("ui.fileSearch.close");return g!==c.e&&Qt(t,"top",c.e=g),d!==c.t&&Qt(t,"right",c.t=d),Q!==c.a&&V(n,"placeholder",c.a=Q),B!==c.o&&(o.disabled=c.o=B),C!==c.i&&V(o,"aria-label",c.i=C),I!==c.n&&(s.disabled=c.n=I),f!==c.s&&V(s,"aria-label",c.s=f),u!==c.h&&V(a,"aria-label",c.h=u),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),Y(()=>n.value=A.query()),t}})}ie(["pointerdown","input","keydown","click"]);var rJ=k('<div data-component=file class="relative outline-none"tabindex=0><div></div><div class="pointer-events-none absolute inset-0 z-0">');const oJ=5e5,sJ={...Ra,lineHeight:24,spacing:0},s4=["mode","media","class","classList","annotations","selectedLines","commentedLines","search","onLineSelected","onLineSelectionEnd","onLineNumberSelectionEnd","onRendered","preloadedDiff"],aJ=["file",...s4],lJ=["fileDiff","before","after","virtualize",...s4];function gJ(A){let e,t,n,i,r,o,s,a=!1,l=null,c=!1;const g=gq(),d=Cq(),[Q,B]=T(0),C=()=>cq(t),I=()=>t4(t),f=lq({wrapper:()=>e,overlay:()=>n,getRoot:C}),u=()=>{i===void 0&&(i=requestAnimationFrame(()=>{i=void 0;const v=c;A.updateSelection(v),c&&(c=!1,A.onLineSelectionEnd(l))}))},p=()=>{r===void 0&&(r=requestAnimationFrame(()=>{r=void 0;const v=A.buildDragSelection();v&&A.setSelectedLines(v)}))},w=v=>{if(!A.enableLineSelection()||v.button!==0)return;const N=A.lineFromMouseEvent(v);if(N.numberColumn){d.begin(!0,N.line);return}N.line!==void 0&&(d.begin(!1,N.line),o=N.line,s=N.line,a=!1,A.onDragStart(N))},m=v=>{if(!A.enableLineSelection())return;const N=A.lineFromMouseEvent(v);if(!d.track(v.buttons,N.line)&&o!==void 0){if((v.buttons&1)===0){o=void 0,s=void 0,a=!1,A.onDragReset(),d.finish();return}N.line!==void 0&&(s=N.line,a=!0,A.onDragMove(N),p())}},y=()=>{if(A.enableLineSelection()&&d.finish()!=="numbers"&&o!==void 0){if(!a){c=!1;const v=A.buildClickSelection();v&&A.setSelectedLines(v),A.onLineSelectionEnd(l),o=void 0,s=void 0,a=!1,A.onDragReset();return}c=!0,p(),u(),o=void 0,s=void 0,a=!1,A.onDragReset()}},M=()=>{if(!A.enableLineSelection()||o===void 0)return;const v=window.getSelection();!v||v.isCollapsed||u()};return F1(()=>{DA(dq(I))}),iA(()=>{Q();const v=A.commentedLines();requestAnimationFrame(()=>{const N=C();N&&A.markCommented(N,v)})}),iA(()=>{A.setSelectedLines(A.selectedLines()??null)}),iA(()=>{A.enableLineSelection()&&(tn(t,"mousedown",w),tn(t,"mousemove",m),tn(window,"mouseup",y),tn(document,"selectionchange",M))}),DA(()=>{yr(g),i!==void 0&&cancelAnimationFrame(i),r!==void 0&&cancelAnimationFrame(r),i=void 0,r=void 0,o=void 0,s=void 0,a=!1,d.reset(),l=null,c=!1}),{get wrapper(){return e},set wrapper(v){e=v},get container(){return t},set container(v){t=v},get overlay(){return n},set overlay(v){n=v},get dragStart(){return o},get dragEnd(){return s},get lastSelection(){return l},set lastSelection(v){l=v},ready:g,bridge:d,rendered:Q,setRendered:B,getRoot:C,getHost:I,find:f,scheduleSelectionUpdate:u}}function a4(A,e){return gJ({enableLineSelection:A.enableLineSelection,selectedLines:A.selectedLines,commentedLines:()=>A.commentedLines()??[],onLineSelectionEnd:A.onLineSelectionEnd,...e})}function l4(A){iA(()=>{const e=A.search();if(!e)return;const t={focus:()=>A.find.focus()};e.register(t),DA(()=>e.register(null))})}function g4(A){const e=t=>{if(!A.normalize)return t;const n=A.normalize(t);return n!==void 0?n:t};return{onLineSelected:t=>{const n=e(t);A.viewer.lastSelection=n,A.onLineSelected?.(n)},onLineSelectionEnd:t=>{const n=e(t);A.viewer.lastSelection=n,A.onLineSelectionEnd?.(n),A.viewer.bridge.consume(n)&&requestAnimationFrame(()=>A.onLineNumberSelectionEnd?.(n))}}}function c4(A){iA(()=>{A.viewer.rendered();const e=A.current();e&&(e.setLineAnnotations(A.annotations()),e.rerender(),requestAnimationFrame(()=>A.viewer.find.refresh({reset:!0})))})}function d4(A){Qq({state:A.viewer.ready,container:A.viewer.container,getRoot:A.viewer.getRoot,isReady:A.isReady,settleFrames:A.settleFrames,onReady:A.onReady})}function Q4(A){yr(A.viewer.ready);const e=A.reset===!0&&A.current!==void 0;e&&A.current?.cleanUp();const t=e||!A.current?A.create():A.current;e||!A.current?(A.viewer.container.innerHTML="",A.assign(t)):A.update?.(t),A.draw(t),Sc(A.viewer.getHost()),A.viewer.setRendered(n=>n+1),A.onReady()}function cJ(A){const e=B4(A.wrapper);if(!e)return()=>{};const t=A.container.getBoundingClientRect().height;if(!t)return()=>{};const n=A.wrapper.getBoundingClientRect().top-e.getBoundingClientRect().top,i=A.container.style.minHeight;A.container.style.minHeight=`${Math.ceil(t)}px`;let r=!1;return()=>{if(r)return;r=!0,A.container.style.minHeight=i;const s=A.wrapper.getBoundingClientRect().top-e.getBoundingClientRect().top-n;s&&(e.scrollTop+=s)}}function B4(A){let e=A.parentElement;for(;e;){const t=getComputedStyle(e);if(t.overflowY==="auto"||t.overflowY==="scroll")return e;e=e.parentElement}}function dJ(A,e){let t,n;const i=()=>{t?.cleanUp(),t=void 0,n=void 0};return{get:()=>{if(!e()){i();return}if(typeof document>"u")return;const r=A();if(!r)return;const o=B4(r)??document;return t&&n===o||(i(),t=new $f,n=o,t.setup(o,o instanceof Document?void 0:r)),t},cleanup:i}}function QJ(A,e){let t;const n=()=>{t?.release(),t=void 0};return{get:()=>{if(!e()){n();return}if(t)return t.virtualizer;const i=A();if(!i)return;const r=mq(i);if(r)return t=r,r.virtualizer},cleanup:n}}function BJ(A){if(!A.dataset.line)return;const e=parseInt(A.dataset.line,10);if(!Number.isNaN(e))return e}function E4(A,e,t){const n=A.composedPath();let i=!1,r,o;for(const s of n)if(s instanceof HTMLElement&&(i=i||s.dataset.columnNumber!=null,r===void 0&&(r=e(s)),o===void 0&&t&&(o=t(s)),i&&r!==void 0&&(t==null||o!==void 0)))break;return{line:r,numberColumn:i,side:o}}function EJ(A){const e=A.dataset.lineType;if(e==="change-deletion")return"deletions";if(e==="change-addition"||e==="change-additions")return"additions";if(A.dataset.code!=null)return A.hasAttribute("data-deletions")?"deletions":"additions"}function CJ(A){const e=Xa(A);if(e)return Zf(e)}function C4(A){return(()=>{var e=rJ(),t=e.firstChild,n=t.nextSibling;return zA(e,"focus",A.viewer.find.onFocus),zA(e,"pointerdown",A.viewer.find.onPointerDown,!0),Xe(i=>A.viewer.wrapper=i,e),h(e,E(H,{get when(){return A.viewer.find.open()},get children(){return E(iJ,{get pos(){return A.viewer.find.pos},get query(){return A.viewer.find.query},get count(){return A.viewer.find.count},get index(){return A.viewer.find.index},get setInput(){return A.viewer.find.setInput},get onInput(){return A.viewer.find.setQuery},get onKeyDown(){return A.viewer.find.onInputKeyDown},get onClose(){return A.viewer.find.close},onPrev:()=>A.viewer.find.next(-1),onNext:()=>A.viewer.find.next(1)})}}),t),Xe(i=>A.viewer.container=i,t),Xe(i=>A.viewer.overlay=i,n),Y(i=>{var r=A.mode,o=Wf,s={...A.classList,[A.class??""]:!!A.class};return r!==i.e&&V(e,"data-mode",i.e=r),i.t=ro(e,o,i.t),i.a=vi(e,s,i.a),i},{e:void 0,t:void 0,a:void 0}),e})()}function uJ(A){let e,t;const[n,i]=MA(A,aJ),r=()=>{const f=n.file.contents;return typeof f=="string"?f:Array.isArray(f)?f.join(`
|
|
809
|
+
`;function z0(A){return{theme:sa,themeType:"system",disableLineNumbers:!1,overflow:"wrap",diffStyle:A??"unified",diffIndicators:"bars",lineHoverHighlight:"both",disableBackground:!1,expansionLineCount:20,hunkSeparators:"line-info-basic",lineDiffType:A==="split"?"word-alt":"none",maxLineDiffLength:1e3,maxLineLengthForHighlighting:1e3,disableFileHeader:!0,unsafeCSS:nq}}const Wf={"--diffs-font-family":"var(--font-family-mono)","--diffs-font-size":"var(--font-size-small)","--diffs-line-height":"24px","--diffs-tab-size":2,"--diffs-font-features":"var(--font-family-mono--font-feature-settings)","--diffs-header-font-family":"var(--font-family-sans)","--diffs-gap-block":0,"--diffs-min-number-column-width":"4ch"};function Zf(A){const e=A.closest("[data-line], [data-alt-line]");if(e instanceof HTMLElement){const n=e.dataset.lineType;if(n==="change-deletion")return"deletions";if(n==="change-addition"||n==="change-additions")return"additions"}const t=A.closest("[data-code]");return t instanceof HTMLElement&&t.hasAttribute("data-deletions")?"deletions":"additions"}function Nc(A,e){const t=e.dataset.lineIndex;if(!t)return;const n=t.split(",").map(i=>parseInt(i,10)).filter(i=>!Number.isNaN(i));if(n.length!==0)return A&&n.length===2?n[1]:n[0]}function aa(A,e,t,n){const i=Array.from(A.querySelectorAll(`[data-line="${t}"], [data-alt-line="${t}"]`)).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const r=n??"additions";for(const o of i)if(Zf(o)===r||parseInt(o.dataset.altLine??"",10)===t)return Nc(e,o)}function mE(A,e){if(!e)return e;if(!A)return;const t=A.querySelector("[data-diff]");if(!(t instanceof HTMLElement))return;const n=t.dataset.diffType==="split",i=aa(A,n,e.start,e.side),r=aa(A,n,e.end,e.endSide??e.side);if(i===void 0||r===void 0)return A.querySelector("[data-line], [data-alt-line]")==null?void 0:null;if(i<=r)return e;const o=e.endSide??e.side,s={start:e.end,end:e.start};return o&&(s.side=o),e.endSide&&e.side&&(s.endSide=e.side),s}function Xf(A){const e=A.dataset.lineAnnotation?.split(",")[1];if(!e)return;const t=parseInt(e,10);if(!Number.isNaN(t))return t}function A4(A){const e=Array.from(A.querySelectorAll("[data-comment-selected]"));for(const t of e)t instanceof HTMLElement&&t.removeAttribute("data-comment-selected")}function iq(A,e){A4(A);const t=A.querySelector("[data-diff]");if(!(t instanceof HTMLElement))return;const n=t.dataset.diffType==="split",i=Array.from(t.querySelectorAll("[data-line-index]")).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const r=Array.from(t.querySelectorAll("[data-line-annotation]")).filter(o=>o instanceof HTMLElement);for(const o of e){const s=aa(A,n,o.start,o.side);if(s===void 0)continue;const a=o.end===o.start&&(o.endSide==null||o.endSide===o.side)?s:aa(A,n,o.end,o.endSide??o.side);if(a===void 0)continue;const l=Math.min(s,a),c=Math.max(s,a);for(const g of i){const d=Nc(n,g);d===void 0||d<l||d>c||g.setAttribute("data-comment-selected","")}for(const g of r){const d=Xf(g);d===void 0||d<l||d>c||g.setAttribute("data-comment-selected","")}}}function rq(A,e){A4(A);const t=Array.from(A.querySelectorAll("[data-line-annotation]")).filter(n=>n instanceof HTMLElement);for(const n of e){const i=Math.max(1,Math.min(n.start,n.end)),r=Math.max(n.start,n.end);for(let o=i;o<=r;o++){const s=Array.from(A.querySelectorAll(`[data-line="${o}"], [data-column-number="${o}"]`));for(const a of s)a instanceof HTMLElement&&a.setAttribute("data-comment-selected","")}for(const o of t){const s=Xf(o);s===void 0||s<i||s>r||o.setAttribute("data-comment-selected","")}}}function oq(A,e){const t=new ResizeObserver(A);return DA(t.disconnect.bind(t)),{observe:n=>t.observe(n,e),unobserve:t.unobserve.bind(t)}}function e4(A,e,t){const n=new WeakMap,{observe:i,unobserve:r}=oq(o=>{for(const s of o){const{contentRect:a,target:l}=s,c=Math.round(a.width),g=Math.round(a.height),d=n.get(l);(!d||d.width!==c||d.height!==g)&&(e(a,l,s),n.set(l,{width:c,height:g}))}},t);iA(o=>{const s=UC(Ns(rA(A)));return TC(s,o,i,r),s},[])}const la=new Set;let $t,w1,wE=!1;function sq(A){return A instanceof HTMLElement?A.closest("[data-prevent-autofocus]")||A.isContentEditable?!0:/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(A.tagName):!1}function yE(A){if(A instanceof Node)for(const e of la){const t=e.element();if(t&&t.isConnected&&t.contains(A))return e}}function aq(){wE||typeof window>"u"||(wE=!0,window.addEventListener("keydown",A=>{if(A.defaultPrevented||sq(A.target)||!(A.metaKey||A.ctrlKey))return;const t=A.key.toLowerCase();if(t==="g"){const r=w1;if(!r||!r.isOpen())return;A.preventDefault(),A.stopPropagation(),r.next(A.shiftKey?-1:1);return}if(t!=="f")return;const n=w1;if(n&&n.isOpen()){A.preventDefault(),A.stopPropagation(),n.open();return}const i=yE(document.activeElement)??yE(A.target)??$t??Array.from(la)[0];i&&(A.preventDefault(),A.stopPropagation(),i.open())},{capture:!0}))}function ti(){const A=globalThis.CSS?.highlights;A&&(A.delete("opencode-find"),A.delete("opencode-find-current"))}function DE(){const A=globalThis;return typeof A.Highlight=="function"&&A.CSS?.highlights!=null}function kE(A){let e=A.parentElement;for(;e;){const t=getComputedStyle(e);if(t.overflowY==="auto"||t.overflowY==="scroll")return e;e=e.parentElement}}function lq(A){let e,t,n="overlay",i=[];const[r,o]=T([]),[s,a]=Pc({open:!1,query:"",index:0,count:0,pos:{top:8,right:8}}),l=()=>s.open,c=()=>s.query,g=()=>s.index,d=()=>s.count,Q=()=>s.pos,B=()=>{o([])},C=()=>{const S=A.overlay();S&&(t!==void 0&&(cancelAnimationFrame(t),t=void 0),S.innerHTML="")},I=()=>{if(n!=="overlay"){C();return}const S=A.wrapper(),G=A.overlay();if(!S||!G||(C(),i.length===0))return;const K=S.getBoundingClientRect(),q=g(),J=document.createDocumentFragment();for(let P=0;P<i.length;P++){const j=i[P],oA=P===q;for(const aA of Array.from(j.getClientRects())){if(!aA.width||!aA.height)continue;const z=document.createElement("div");z.style.position="absolute",z.style.left=`${Math.round(aA.left-K.left)}px`,z.style.top=`${Math.round(aA.top-K.top)}px`,z.style.width=`${Math.round(aA.width)}px`,z.style.height=`${Math.round(aA.height)}px`,z.style.borderRadius="2px",z.style.backgroundColor=oA?"var(--surface-warning-strong)":"var(--surface-warning-base)",z.style.opacity=oA?"0.55":"0.35",oA&&(z.style.boxShadow="inset 0 0 0 1px var(--border-warning-base)"),J.appendChild(z)}}G.appendChild(J)};function f(){n==="overlay"&&l()&&t===void 0&&(t=requestAnimationFrame(()=>{t=void 0,I()}))}const u=()=>{if(n!=="overlay")return;const S=A.getRoot(),G=S?Array.from(S.querySelectorAll("[data-code]")).filter(q=>q instanceof HTMLElement):[],K=r();G.length===K.length&&G.every((q,J)=>q===K[J])||(B(),o(G))},p=()=>{ti(),C(),B(),i=[],a("count",0),a("index",0)},w=()=>{if(typeof window>"u")return;const S=A.wrapper();if(!S)return;const G=kE(S)??S,K=G.getBoundingClientRect(),q=parseFloat(getComputedStyle(G).getPropertyValue("--session-title-height")),J=Number.isNaN(q)?0:q;a("pos",{top:Math.round(K.top)+J-4,right:Math.round(window.innerWidth-K.right)+8})},m=(S,G)=>{const K=G.toLowerCase(),q=[],J=Array.from(S.querySelectorAll("[data-content] [data-line], [data-column-content]")).filter(P=>P instanceof HTMLElement);for(const P of J){const j=P.textContent;if(!j)continue;const oA=j.toLowerCase();let aA=oA.indexOf(K);if(aA===-1)continue;const z=[],dA=[],sA=document.createTreeWalker(P,NodeFilter.SHOW_TEXT);let lA=sA.nextNode(),EA=0;for(;lA;)lA instanceof Text&&(EA+=lA.data.length,z.push(lA),dA.push(EA)),lA=sA.nextNode();if(z.length===0)continue;const CA=UA=>{let kA=0,bA=dA.length-1;for(;kA<bA;){const re=kA+bA>>1;dA[re]>=UA?bA=re:kA=re+1}const PA=kA===0?0:dA[kA-1];return{node:z[kA],offset:UA-PA}};for(;aA!==-1;){const UA=CA(aA),kA=CA(aA+G.length),bA=document.createRange();bA.setStart(UA.node,UA.offset),bA.setEnd(kA.node,kA.offset),q.push(bA),aA=oA.indexOf(K,aA+G.length)}}return q},y=S=>{const G=S.startContainer;(G instanceof Element?G:G.parentElement)?.scrollIntoView({block:"center",inline:"center"})},M=(S,G)=>{const K=globalThis.CSS?.highlights,q=globalThis.Highlight;if(!K||typeof q!="function")return!1;K.delete("opencode-find"),K.delete("opencode-find-current");const J=S[G];J&&K.set("opencode-find-current",new q(J));const P=S.filter((j,oA)=>oA!==G);return P.length>0&&K.set("opencode-find",new q(...P)),!0},v=S=>{if(!l())return;const G=c().trim();if(!G){p();return}const K=A.getRoot();if(!K)return;n=DE()?"highlights":"overlay";const q=m(K,G),J=q.length,P=S?.reset?0:g(),j=J?Math.min(P,J-1):0;i=q,a("count",J),a("index",j);const oA=q[j];if(n==="highlights"){C(),B(),M(q,j)||(n="overlay",ti(),u(),f()),S?.scroll&&oA&&y(oA);return}ti(),u(),S?.scroll&&oA&&y(oA),f()},N=()=>{a("open",!1),a("query",""),p(),w1===x&&(w1=void 0)},_=()=>{w1&&w1!==x&&w1.close(),w1=x,$t=x,l()||a("open",!0),requestAnimationFrame(()=>{v({scroll:!0}),e?.focus(),e?.select()})},F=S=>{if(!l())return;const G=d();if(G<=0)return;const K=(g()+S+G)%G;a("index",K);const q=i[K];if(q){if(n==="highlights"){if(!M(i,K)){n="overlay",v({reset:!0,scroll:!0});return}y(q);return}ti(),u(),y(q),f()}},x={element:A.wrapper,isOpen:()=>l(),next:F,open:_,close:N};return iA(()=>{for(const S of r())tn(S,"scroll",f,{passive:!0})}),F1(()=>{n=DE()?"highlights":"overlay",aq(),la.add(x),$t||($t=x),DA(()=>{la.delete(x),w1===x&&(w1=void 0,ti()),$t===x&&($t=void 0)})}),iA(()=>{if(!l())return;const S=()=>w();requestAnimationFrame(S),tn(window,"resize",S,{passive:!0});const G=A.wrapper();if(!G)return;const K=kE(G)??G;e4(K,S)}),DA(()=>{B(),C(),w1===x&&(w1=void 0,ti())}),{open:l,query:c,count:d,index:g,pos:Q,setInput:S=>{e=S},setQuery:S=>{a("query",S),a("index",0),v({reset:!0,scroll:!0})},focus:_,close:N,next:F,refresh:S=>v(S),onPointerDown:()=>{$t=x,A.wrapper()?.focus({preventScroll:!0})},onFocus:()=>{$t=x},onInputKeyDown:S=>{if(S.key==="Escape"){S.preventDefault(),N();return}S.key==="Enter"&&(S.preventDefault(),F(S.shiftKey?-1:1))}}}function gq(){return{token:0}}function yr(A){A.observer?.disconnect(),A.observer=void 0}function t4(A){if(!A)return;const e=A.querySelector("diffs-container");if(e instanceof HTMLElement)return e}function cq(A){return t4(A)?.shadowRoot??void 0}function Sc(A){if(!A||typeof document>"u")return;const e=document.documentElement.dataset.colorScheme;if(e==="dark"||e==="light"){A.dataset.colorScheme=e;return}A.removeAttribute("data-color-scheme")}function dq(A){if(typeof document>"u")return()=>{};if(Sc(A()),typeof MutationObserver>"u")return()=>{};const e=document.documentElement,t=new MutationObserver(()=>Sc(A()));return t.observe(e,{attributes:!0,attributeFilter:["data-color-scheme"]}),()=>t.disconnect()}function Qq(A){yr(A.state),A.state.token+=1;const e=A.state.token,t=Math.max(0,A.settleFrames??0),n=()=>{const o=s=>{if(e===A.state.token){if(s<=0){A.onReady();return}requestAnimationFrame(()=>o(s-1))}};requestAnimationFrame(()=>o(t))},i=o=>{if(A.isReady(o)){n();return}typeof MutationObserver>"u"||(yr(A.state),A.state.observer=new MutationObserver(()=>{e===A.state.token&&A.isReady(o)&&(yr(A.state),n())}),A.state.observer.observe(o,{childList:!0,subtree:!0}))},r=A.getRoot();if(!r){if(typeof MutationObserver>"u")return;A.state.observer=new MutationObserver(()=>{if(e!==A.state.token)return;const o=A.getRoot();o&&i(o)}),A.state.observer.observe(A.container,{childList:!0,subtree:!0});return}i(r)}function Bq(A){return A?A.start===A.end&&(A.endSide==null||A.endSide===A.side):!1}function Eq(A){if(A instanceof Range)return A;const e=new Range;return e.setStart(A.startContainer,A.startOffset),e.setEnd(A.endContainer,A.endOffset),e}function n4(A,e){!A||!e||requestAnimationFrame(()=>{const t=A.getSelection?.()??window.getSelection();if(t)try{t.removeAllRanges(),t.addRange(e)}catch{}})}function Cq(){let A="none",e,t=!1,n=!1;const i=()=>{A="none",e=void 0,t=!1};return{begin(r,o){if(!r){A="text";return}A="numbers",e=o,t=!1},track(r,o){return A!=="numbers"?!1:(r&1)===0?(i(),!0):(o!==void 0&&e!==void 0&&o!==e&&(t=!0),!0)},finish(){const r=A;return n=r==="numbers"&&t,i(),r},consume(r){const o=n&&!Bq(r);return n=!1,o},reset(){n=!1,i()}}}function Xa(A){if(A)return A instanceof HTMLElement?A:A.parentElement??void 0}function uq(A){const e=Xa(A);if(!e)return;const t=e.closest("[data-line]");if(!(t instanceof HTMLElement))return;const n=parseInt(t.dataset.line??"",10);if(!Number.isNaN(n))return n}function bE(A){const e=Xa(A);if(!e)return;const t=e.closest("[data-line], [data-alt-line]");if(!(t instanceof HTMLElement))return;const n=parseInt(t.dataset.line??"",10);if(!Number.isNaN(n))return n;const i=parseInt(t.dataset.altLine??"",10);if(!Number.isNaN(i))return i}function hq(A){const e=Xa(A);if(!e)return;const t=e.closest("[data-code]");if(t instanceof HTMLElement)return t.hasAttribute("data-deletions")?"deletions":"additions"}function i4(A){const e=A.root.getSelection?.()??window.getSelection();if(!e||e.isCollapsed)return;const t=e.getComposedRanges?.({shadowRoots:[A.root]})?.[0]??(e.rangeCount>0?e.getRangeAt(0):void 0),n=t?.startContainer??e.anchorNode,i=t?.endContainer??e.focusNode;if(!n||!i||!A.root.contains(n)||!A.root.contains(i))return;const r=A.lineForNode(n),o=A.lineForNode(i);if(r===void 0||o===void 0)return;const s=A.sideForNode?.(n),a=A.sideForNode?.(i),l=s??a,c={start:r,end:o};return l&&(c.side=l),a&&l&&a!==l&&(c.endSide=a),{range:c,text:A.preserveTextSelection&&t?Eq(t).cloneRange():void 0}}const ts=new WeakMap,Iq={lineHeight:24,hunkSeparatorHeight:24,spacing:0};function fq(A){return A==="auto"||A==="scroll"||A==="overlay"}function vE(A){let e=A.parentElement;for(;e;){const t=getComputedStyle(e);if(fq(t.overflowY))return e;e=e.parentElement}}function pq(A){if(typeof document>"u")return;const e=A.closest("[data-component='session-review']");if(e instanceof HTMLElement){const n=vE(A)??e,i=e.querySelector("[data-slot='session-review-container']");return{key:e,root:n,content:i instanceof HTMLElement?i:void 0}}const t=vE(A);if(t){const n=t.querySelector("[role='log']");return{key:t,root:t,content:n instanceof HTMLElement?n:void 0}}return{key:document,root:document,content:void 0}}function mq(A){const e=pq(A);if(!e)return;let t=ts.get(e.key);if(!t){const i=new $f;i.setup(e.root,e.content),t={virtualizer:i,refs:0},ts.set(e.key,t)}t.refs+=1;let n=!1;return{virtualizer:t.virtualizer,release(){if(n)return;n=!0;const i=ts.get(e.key);i&&(i.refs-=1,!(i.refs>0)&&(i.virtualizer.cleanUp(),ts.delete(e.key)))}}}function wq(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var lr={exports:{}},yq=lr.exports,ME;function Dq(){return ME||(ME=1,(function(A,e){(function(t,n){n(e)})(yq,function(t){const n=Symbol("newer"),i=Symbol("older");class r{constructor(g,d){typeof g!="number"&&(d=g,g=0),this.size=0,this.limit=g,this.oldest=this.newest=void 0,this._keymap=new Map,d&&(this.assign(d),g<1&&(this.limit=this.size))}_markEntryAsUsed(g){g!==this.newest&&(g[n]&&(g===this.oldest&&(this.oldest=g[n]),g[n][i]=g[i]),g[i]&&(g[i][n]=g[n]),g[n]=void 0,g[i]=this.newest,this.newest&&(this.newest[n]=g),this.newest=g)}assign(g){let d,Q=this.limit||Number.MAX_VALUE;this._keymap.clear();let B=g[Symbol.iterator]();for(let C=B.next();!C.done;C=B.next()){let I=new o(C.value[0],C.value[1]);if(this._keymap.set(I.key,I),d?(d[n]=I,I[i]=d):this.oldest=I,d=I,Q--==0)throw new Error("overflow")}this.newest=d,this.size=this._keymap.size}get(g){var d=this._keymap.get(g);return d?(this._markEntryAsUsed(d),d.value):void 0}set(g,d){var Q=this._keymap.get(g);return Q?(Q.value=d,this._markEntryAsUsed(Q),this):(this._keymap.set(g,Q=new o(g,d)),this.newest?(this.newest[n]=Q,Q[i]=this.newest):this.oldest=Q,this.newest=Q,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var g=this.oldest;if(g)return this.oldest[n]?(this.oldest=this.oldest[n],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),g[n]=g[i]=void 0,this._keymap.delete(g.key),--this.size,[g.key,g.value]}find(g){let d=this._keymap.get(g);return d?d.value:void 0}has(g){return this._keymap.has(g)}delete(g){var d=this._keymap.get(g);return d?(this._keymap.delete(d.key),d[n]&&d[i]?(d[i][n]=d[n],d[n][i]=d[i]):d[n]?(d[n][i]=void 0,this.oldest=d[n]):d[i]?(d[i][n]=void 0,this.newest=d[i]):this.oldest=this.newest=void 0,this.size--,d.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new a(this.oldest)}values(){return new l(this.oldest)}entries(){return this}[Symbol.iterator](){return new s(this.oldest)}forEach(g,d){typeof d!="object"&&(d=this);let Q=this.oldest;for(;Q;)g.call(d,Q.value,Q.key,this),Q=Q[n]}toJSON(){for(var g=new Array(this.size),d=0,Q=this.oldest;Q;)g[d++]={key:Q.key,value:Q.value},Q=Q[n];return g}toString(){for(var g="",d=this.oldest;d;)g+=String(d.key)+":"+d.value,d=d[n],d&&(g+=" < ");return g}}t.LRUMap=r;function o(c,g){this.key=c,this.value=g,this[n]=void 0,this[i]=void 0}function s(c){this.entry=c}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:[c.key,c.value]}):{done:!0,value:void 0}};function a(c){this.entry=c}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:c.key}):{done:!0,value:void 0}};function l(c){this.entry=c}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let c=this.entry;return c?(this.entry=c[n],{done:!1,value:c.value}):{done:!0,value:void 0}}})})(lr,lr.exports)),lr.exports}var kq=Dq();const NE=wq(kq),ns=Symbol("IGNORE_RESPONSE");var Bg=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},bq=class{highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(A,{langs:e,theme:t=Ce,useTokenTransformer:n=!1,lineDiffType:i="word-alt",maxLineDiffLength:r=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:s="shiki-js"}){this.options=A,this.preferredHighlighter=s,this.renderOptions={theme:t,useTokenTransformer:n,lineDiffType:i,maxLineDiffLength:r,tokenizeMaxLineLength:o},this.fileCache=new NE.LRUMap(A.totalASTLRUCacheSize??100),this.diffCache=new NE.LRUMap(A.totalASTLRUCacheSize??100),this.queueInitialization(e)}isWorkingPool(){return!this.workersFailed}getFileResultCache(A){return A.cacheKey!=null?this.fileCache.get(A.cacheKey):void 0}getDiffResultCache(A){return A.cacheKey!=null?this.diffCache.get(A.cacheKey):void 0}inspectCaches(){const{fileCache:A,diffCache:e}=this;return{fileCache:A,diffCache:e}}evictFileFromCache(A){try{return this.fileCache.delete(A)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(A){try{return this.diffCache.delete(A)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:A=this.renderOptions.theme??Ce,useTokenTransformer:e=this.renderOptions.useTokenTransformer??!1,lineDiffType:t=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:n=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:i=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:r}=this,o=++this.renderOptionsRequestVersion,s=()=>this.isCurrentLifecycle(r)&&this.renderOptionsRequestVersion===o;try{const a={theme:A,useTokenTransformer:e,lineDiffType:t,maxLineDiffLength:n,tokenizeMaxLineLength:i};if(this.isInitialized()||await this.initialize(),!s()||Ft(a,this.renderOptions))return;const l=zr(A);let c=[];if(_i(a.theme,this.renderOptions.theme)||(yc(l)?c=IE(l):c=await fE(l)),!s())return;if(this.highlighter!=null)wc(c,this.highlighter);else{const d=await ea({themes:l,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!s())return;this.highlighter=d}const g=this.setRenderOptionsOnWorkers(a,c);this.renderOptions=a,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const d of this.themeSubscribers)d.onThemeChange();await g}catch(a){if(a instanceof Bg||!s())return;throw a}}getFileRenderOptions(){const{tokenizeMaxLineLength:A,theme:e,useTokenTransformer:t}=this.renderOptions;return{theme:e,useTokenTransformer:t,tokenizeMaxLineLength:A}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(A,e){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const t=[];for(const n of this.workers){if(!n.initialized)throw console.log({managedWorker:n}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");t.push(new Promise((i,r)=>{const o=this.generateRequestId(),s={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:A,resolvedThemes:e},resolve:i,reject:r,requestStart:Date.now()};this.activeTaskById.set(o,s),n.pendingSetupRequestId=o,n.worker.postMessage(s.request)}))}await Promise.all(t)}subscribeToThemeChanges(A){return this.themeSubscribers.add(A),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(A),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(A){this.themeSubscribers.delete(A),this.queueBroadcastStateChanges()}subscribeToStatChanges(A){return this.statSubscribers.add(A),A(this.getStats()),()=>{this.statSubscribers.delete(A)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const A=this.getStats();for(const e of this.statSubscribers)e(A)};cleanUpTasks(A){this.detachInstanceFromQueuedTasks(A);const e=this.activeRequestByInstance.get(A);if(e!=null){const t=this.activeTaskById.get(e);En(t)?(this.detachInstanceFromRenderTask(t,A),!t.primeCache&&t.instances.size===0&&this.removeActiveTask(t)):this.activeTaskById.delete(e)}this.activeRequestByInstance.delete(A),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(A=[]){if(this.initialized!==!0)if(this.initialized===!1){const{lifecycleGeneration:e}=this;this.initialized=new Promise((t,n)=>{(async()=>{try{const i=zr(this.renderOptions.theme);let r=[];if(yc(i)?r=IE(i):r=await fE(i),!this.isCurrentLifecycle(e)){t();return}let o=[];if(uE(A)?o=CE(A):o=await hE(A),!this.isCurrentLifecycle(e)){t();return}const[s]=await Promise.all([ea({themes:i,langs:["text",...A],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(r,o)]);if(!this.isCurrentLifecycle(e)){this.terminateWorkers(),t();return}this.highlighter=s,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),t()}catch(i){if(i instanceof Bg||!this.isCurrentLifecycle(e)){t();return}this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),n(i)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(A,e){this.workersFailed=!1;const t=[],n=void 0;this.workers.length>0&&this.terminateWorkers();for(let i=0;i<(this.options.poolSize??8);i++){const r=this.options.workerFactory(),o={worker:r,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...e.map(({name:s})=>s)]),customExtensionsVersion:0};r.addEventListener("message",s=>{this.handleWorkerMessage(o,s.data)}),r.addEventListener("error",s=>console.error("Worker error:",s,o)),this.workers.push(o),t.push(new Promise((s,a)=>{const l=this.generateRequestId(),c={type:"initialize",id:l,request:{type:"initialize",id:l,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:A,resolvedLanguages:e,customExtensionsVersion:void 0,customExtensionMap:n},resolve(){o.initialized=!0,s()},reject:a,requestStart:Date.now()};this.activeTaskById.set(l,c),this.executeTask(o,c)}))}await Promise.all(t)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let A=0;A<this.queuedTasks.length;){const e=this.queuedTasks[A];if(this.hasActiveRequest(e)){A++;continue}const t=SE(e),n=this.getAvailableWorker(t);if(n==null)break;this.queuedTasks.splice(A,1),this.assignWorkerToTask(e,n),this.resolveLanguagesAndExecuteTask(n,e,t)}this.queueBroadcastStateChanges()}};highlightFileAST(A,e){const t=this.getFileResultCache(e);$r(e)||t!=null&&An(t.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(A,e)||this.submitTask(A,{type:"file",file:e})}primeFileHighlightCache(A){if(A.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${A.name}".`);return}const e=this.getFileResultCache(A),t=this.getFileHighlightKey(A);if(t==null||$r(A)||e!=null&&An(e.options,this.getFileRenderOptions()))return;const n=this.getTaskByHighlightKey(t);n!=null?n.primeCache=!0:this.submitCacheTask({type:"file",file:A},t)}getPlainFileAST(A,e,t,n){if(this.highlighter==null){this.queueInitialization();return}return Df(A,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:e,totalLines:t,lines:n})}highlightDiffAST(A,e){const t=this.getDiffResultCache(e);Ao(e)||t!=null&&Ft(t.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(A,e)||this.submitTask(A,{type:"diff",diff:e})}primeDiffHighlightCache(A){if(A.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${A.prevName??A.name}" -> "${A.name}".`);return}const e=this.getDiffResultCache(A),t=this.getDiffHighlightKey(A);if(t==null||Ao(A)||e!=null&&Ft(e.options,this.getDiffRenderOptions()))return;const n=this.getTaskByHighlightKey(t);n!=null?n.primeCache=!0:this.submitCacheTask({type:"diff",diff:A},t)}getPlainDiffAST(A,e,t,n,i){return this.highlighter!=null?jf(A,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:e,totalLines:t,expandedHunks:n,collapsedContextThreshold:i}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(A){return this.lifecycleGeneration===A}queueInitialization(A){this.initialize(A).catch(e=>{console.error(e)})}cancelActiveWorkerTasks(){const A=new Bg;for(const e of this.activeTaskById.values())"reject"in e&&e.reject(A)}terminateWorkers(){for(const A of this.workers)A.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(A=>A.requestId!=null||A.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(A,e){this.initialized===!1&&this.queueInitialization();const t=this.getHighlightKeyForRequest(e),n=t!=null?this.getTaskByHighlightKey(t):void 0;if(n!=null){this.detachInstanceFromQueuedTasks(A,n),this.addInstanceToTask(n,A),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(A);const i=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:o}=this,s=(()=>{switch(e.type){case"file":return{type:"file",id:i,request:{...e,id:i},instances:new Set([A]),primeCache:!1,highlightKey:t,renderOptionsVersion:o,requestStart:r};case"diff":return{type:"diff",id:i,request:{...e,id:i},instances:new Set([A]),primeCache:!1,highlightKey:t,renderOptionsVersion:o,requestStart:r}}})();this.enqueueRenderTask(s,A)}submitCacheTask(A,e){this.initialized===!1&&this.queueInitialization();const t=this.generateRequestId(),n=Date.now(),{renderOptionsVersion:i}=this,r=(()=>{switch(A.type){case"file":return{type:"file",id:t,request:{...A,id:t},instances:new Set,primeCache:!0,highlightKey:e,renderOptionsVersion:i,requestStart:n};case"diff":return{type:"diff",id:t,request:{...A,id:t},instances:new Set,primeCache:!0,highlightKey:e,renderOptionsVersion:i,requestStart:n}}})();this.enqueueRenderTask(r)}enqueueRenderTask(A,e){this.queuedTasks.push(A),e!=null&&this.queuedTaskByInstance.set(e,A),A.highlightKey!=null&&this.taskByHighlightKey.set(A.highlightKey,A),this.queueDrain()}async resolveLanguagesAndExecuteTask(A,e,t){try{const n=t.filter(i=>!A.langs.has(i));if(n.length>0&&(uE(n)?e.request.resolvedLanguages=CE(n):e.request.resolvedLanguages=await hE(n)),!this.activeTaskById.has(e.id)){A.requestId===e.id&&(this.cleanWorkerAndTask(A,e),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(A,e)}catch{this.cleanWorkerAndTask(A,e),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(A,e){const t=this.activeTaskById.get(e.id);try{if(t==null)throw ns;if(e.type==="error"){const n=new Error(e.error);if(e.stack&&(n.stack=e.stack),"reject"in t)t.reject(n);else if(En(t))this.notifyHighlightError(t,n);else throw new Error("handleWorkerMessage: unknown task type");throw n}else switch(e.requestType){case"initialize":if(t.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");this.syncCustomExtensionVersion(A,t.request),t.resolve();break;case"set-render-options":if(t.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");t.resolve();break;case"file":{if(t.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:n,options:i}=e;if(!this.isCurrentRenderTask(t)||!An(i,this.getFileRenderOptions()))throw ns;const{request:r}=t;this.syncCustomExtensionVersion(A,r),r.file.cacheKey!=null&&this.fileCache.set(r.file.cacheKey,{result:n,options:i}),this.notifyFileInstances(t,n,i);break}case"diff":{if(t.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:n,options:i}=e;if(!this.isCurrentRenderTask(t)||!Ft(i,this.getDiffRenderOptions()))throw ns;const{request:r}=t;this.syncCustomExtensionVersion(A,r),r.diff.cacheKey!=null&&this.diffCache.set(r.diff.cacheKey,{result:n,options:i}),this.notifyDiffInstances(t,n,i);break}}}catch(n){n!==ns&&console.error(n,t,e)}this.cleanWorkerAndTask(A,t,e.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(A,e){e.requestId=A.id,En(A)&&(this.clearQueuedInstanceRequests(A),this.trackInstanceRequests(A)),this.activeTaskById.set(A.id,A)}cleanWorkerAndTask(A,e,t=e?.id){A.requestId===t&&(A.requestId=void 0),A.pendingSetupRequestId===t&&(A.pendingSetupRequestId=void 0),e!=null&&(En(e)&&(this.clearInstanceRequests(e),this.clearHighlightKey(e)),this.activeTaskById.delete(e.id))}executeTask(A,e){vq(e.request)&&this.maybeAttachCustomExtensions(A,e.request),this.activeTaskById.has(e.id)||this.assignWorkerToTask(e,A);for(const t of SE(e))A.langs.add(t);try{A.worker.postMessage(e.request)}catch(t){console.error("Failed to post message to worker:",t),En(e)?this.notifyHighlightError(e,t):"reject"in e&&e.reject(t),this.cleanWorkerAndTask(A,e),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(A,e){if(e.customExtensionsVersion!=null)return;const t=aO();A.customExtensionsVersion>=t||(e.customExtensionsVersion=t,e.customExtensionMap=lO())}syncCustomExtensionVersion(A,e){e.customExtensionsVersion!=null&&(A.customExtensionsVersion=e.customExtensionsVersion)}getAvailableWorker(A){let e;for(const t of this.workers){if(t.requestId!=null||t.pendingSetupRequestId!=null||!t.initialized)continue;if(e=t,A.length===0)break;let n=!0;for(const i of A)if(!t.langs.has(i)){n=!1;break}if(n)break}return e}getFileHighlightKey(A){if(A.cacheKey!=null)return`file:${A.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(A){if(A.cacheKey!=null)return`diff:${A.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(A){switch(A.type){case"file":return this.getFileHighlightKey(A.file);case"diff":return this.getDiffHighlightKey(A.diff)}}hasActiveRequest(A){for(const e of Zi(A))if(this.activeRequestByInstance.has(e))return!0;return!1}addInstanceToTask(A,e){A.type,A.instances.add(e),this.activeTaskById.has(A.id)?this.activeRequestByInstance.set(e,A.id):this.queuedTaskByInstance.set(e,A)}detachInstanceFromQueuedTasks(A,e){const t=this.queuedTaskByInstance.get(A);t==null||t===e||(this.queuedTaskByInstance.delete(A),this.detachInstanceFromRenderTask(t,A),!t.primeCache&&t.instances.size===0&&this.removeQueuedTask(t))}detachInstanceFromRenderTask(A,e){A.type,A.instances.delete(e)}removeQueuedTask(A){const e=this.queuedTasks.indexOf(A);e!==-1&&this.queuedTasks.splice(e,1),this.clearQueuedInstanceRequests(A),this.clearHighlightKey(A)}removeActiveTask(A){this.clearInstanceRequests(A),this.clearHighlightKey(A),this.activeTaskById.delete(A.id)}invalidateRenderTasks(){for(let A=this.queuedTasks.length-1;A>=0;A--){const e=this.queuedTasks[A];e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(e)}for(const A of Array.from(this.activeTaskById.values()))En(A)&&A.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(A)}clearQueuedInstanceRequests(A){for(const e of Zi(A))this.queuedTaskByInstance.get(e)===A&&this.queuedTaskByInstance.delete(e)}clearHighlightKey(A){A.highlightKey!=null&&this.taskByHighlightKey.get(A.highlightKey)===A&&this.taskByHighlightKey.delete(A.highlightKey)}trackInstanceRequests(A){for(const e of Zi(A))this.activeRequestByInstance.set(e,A.id)}clearInstanceRequests(A){for(const e of Zi(A))this.activeRequestByInstance.get(e)===A.id&&this.activeRequestByInstance.delete(e)}notifyFileInstances(A,e,t){for(const n of A.instances)this.activeRequestByInstance.get(n)===A.id&&n.onHighlightSuccess(A.request.file,e,t)}notifyDiffInstances(A,e,t){for(const n of A.instances)this.activeRequestByInstance.get(n)===A.id&&n.onHighlightSuccess(A.request.diff,e,t)}notifyHighlightError(A,e){for(const t of Zi(A))this.activeRequestByInstance.get(t)===A.id&&t.onHighlightError(e)}hasMatchingFileInstanceTask(A,e){for(const t of this.iterateRenderTasks())if(t.type==="file"&&this.isCurrentRenderTask(t)&&t.instances.has(A)&&Ct(e,t.request.file))return!0;return!1}hasMatchingDiffInstanceTask(A,e){for(const t of this.iterateRenderTasks())if(t.type==="diff"&&this.isCurrentRenderTask(t)&&t.instances.has(A)&&Qi(t.request.diff,e))return!0;return!1}getTaskByHighlightKey(A){const e=this.taskByHighlightKey.get(A);return e!=null&&this.isCurrentRenderTask(e)?e:void 0}isCurrentRenderTask(A){return A.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(const A of this.queuedTasks)yield A;for(const A of this.activeTaskById.values())En(A)&&(yield A)}generateRequestId(){return`req_${++this.nextRequestId}`}};function vq(A){return A.type==="initialize"||A.type==="file"||A.type==="diff"}function SE(A){const e=new Set;if(A.type==="initialize"||A.type==="set-render-options")return[];switch(A.type){case"file":e.add(A.request.file.lang??Ye(A.request.file.name));break;case"diff":e.add(A.request.diff.lang??Ye(A.request.diff.name)),e.add(A.request.diff.lang??Ye(A.request.diff.prevName??"-"));break}return e.delete("text"),Array.from(e)}function En(A){return A?.type==="file"||A?.type==="diff"}function Zi(A){return A.instances}const Mq="/console/assets/worker-BVEmEyu5.js";tq();function Nq(){return new Worker(Mq,{type:"module"})}function xE(A){const e=new bq({workerFactory:Nq,poolSize:2},{theme:sa,lineDiffType:A,preferredHighlighter:"shiki-wasm"});return e.initialize(),e}let Eg,Cg;function ga(A){if(!(typeof window>"u"))return A==="split"?(Cg||(Cg=xE("word-alt")),Cg):(Eg||(Eg=xE("none")),Eg)}var Sq=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),xq=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Lq(A){if(Intl.Locale){const t=new Intl.Locale(A).maximize().script??"";return Sq.has(t)}const e=A.split("-")[0];return xq.has(e)}function _q(A){return Lq(A)?"rtl":"ltr"}function r4(){let A=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([A])}catch{A="en-US"}return{locale:A,direction:_q(A)}}var xc=r4(),gr=new Set;function LE(){xc=r4();for(const A of gr)A(xc)}function Fq(){const[A,e]=T(xc),t=R(()=>A());return F1(()=>{gr.size===0&&window.addEventListener("languagechange",LE),gr.add(e),DA(()=>{gr.delete(e),gr.size===0&&window.removeEventListener("languagechange",LE)})}),{locale:()=>t().locale,direction:()=>t().direction}}var Gq=A1();function o4(){const A=Fq();return Pe(Gq)||A}var ug=new Map;function Rq(A){const{locale:e}=o4(),t=R(()=>e()+(A?Object.entries(A).sort((n,i)=>n[0]<i[0]?-1:1).join():""));return R(()=>{const n=t();let i;return ug.has(n)&&(i=ug.get(n)),i||(i=new Intl.Collator(e(),A),ug.set(n,i)),i})}const Uq={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.git":"Git changes","ui.sessionReview.title.branch":"Branch changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReviewV2.expandMode":"Expand or collapse diff","ui.sessionReviewV2.filterFiles":"Filter files","ui.sessionReviewV2.toggleSidebar":"Toggle file tree","ui.sessionReviewV2.showAllLines":"Show all lines","ui.sessionReviewV2.hideNonDiffLines":"Hide non-diff lines","ui.sessionReviewV2.unifiedDiff":"Unified diff","ui.sessionReviewV2.splitDiff":"Split diff","ui.sessionReviewV2.previousFile":"Previous file","ui.sessionReviewV2.nextFile":"Next file","ui.sessionReviewV2.diffView":"Diff view","ui.sessionReviewV2.empty.noGit.title":"No tracked changes","ui.sessionReviewV2.empty.noGit.description":"Track, review, and undo changes in this project","ui.sessionReviewV2.empty.noGit.action":"Create Git repository","ui.sessionReviewV2.empty.noGit.actionLoading":"Creating Git repository...","ui.sessionReviewV2.empty.changes.title":"No file changes yet","ui.sessionReviewV2.empty.changes.description":"Project changes will appear here","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.contextPlaceholder":"Add context for this change","ui.lineComment.submit":"Comment","ui.lineComment.cancel":"Cancel","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.diffs.changed.one":"{{count}} Changed file","ui.sessionTurn.diffs.changed.other":"{{count}} Changed files","ui.sessionTurn.diffs.showAll":"Show all","ui.sessionTurn.diffs.showLess":"Show less","ui.sessionTurn.diffs.more":"+{{count}} more files","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addCredits":"Add credits","dialog.usageExceeded.freeTier.title":"Free limit reached","dialog.usageExceeded.freeTier.description":"Subscribe to Kilo Go for reliable access to the best open-source models, starting at $5/month.","dialog.usageExceeded.freeTier.actionLabel":"Subscribe","dialog.usageExceeded.accountRateLimit.title":"Go limit reached","dialog.usageExceeded.accountRateLimit.description":"Usage limit reached. To continue using this model now, enable usage from your available balance","dialog.usageExceeded.accountRateLimit.actionLabel":"Open settings","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.delegatingWaitingPermission":"Subagent waiting for permission","ui.sessionTurn.status.delegatingWaitingQuestion":"Subagent waiting for response","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.messagePart.mcp.input":"Input","ui.messagePart.mcp.output":"Output","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.promptInput.noMatchingItems":"No matching items","ui.promptInput.commands":"Commands","ui.promptInput.dropFiles":"Drop files to attach","ui.promptInput.removeAttachment":"Remove attachment","ui.promptInput.label":"Prompt","ui.promptInput.placeholder.shell":"Enter shell command...","ui.promptInput.placeholder.normal":"Ask anything, {{slash}} for commands, {{at}} for context...","ui.promptInput.add":"Add images and files","ui.promptInput.attachments":"Images and files","ui.promptInput.context":"Context","ui.promptInput.shell":"Shell command","ui.promptInput.chooseAgent":"Choose agent","ui.promptInput.chooseModel":"Choose model","ui.promptInput.chooseVariant":"Choose model variant","ui.promptInput.send":"Send","ui.promptInput.stop":"Stop","ui.tabs.close":"Close tab","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.mermaid.rendering":"Rendering Mermaid diagram...","ui.mermaid.renderError":"Mermaid render failed: {{message}}","ui.mermaid.errorDefault":"Unable to render Mermaid diagram.","ui.mermaid.errorEmpty":"Mermaid rendered an empty diagram.","ui.mermaid.download":"Download","ui.mermaid.copySource":"Copy Mermaid source","ui.mermaid.copySvg":"Copy SVG","ui.mermaid.copyPng":"Copy PNG","ui.mermaid.downloadSvg":"Download SVG","ui.mermaid.downloadPng":"Download PNG","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.websearch.provider":"{{provider}} Web Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.questions.numbered":"Questions {{number}}","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.clear":"Clear","ui.common.file":"File","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.common.showMore":"Show more","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.deleteQueued":"Delete queued message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert to here","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.question.subtitle.answered":"{{count}} answered","ui.question.subtitle.dismissed":"{{count}} dismissed","ui.question.answer.none":"(no answer)","ui.question.answer.dismissed":"Dismissed","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."},Xi=new Map;function Tq(A,e){const t=Xi.get(A);if(t)return t.select(e);const n=new Intl.PluralRules(A);return Xi.size>=32&&Xi.delete(Xi.keys().next().value),Xi.set(A,n),n.select(e)}function Oq(A,e){return`${A}.${e}`}function Kq(A,e){return e?A.replace(/{{\s*([^}]+?)\s*}}/g,(t,n)=>{const i=String(n),r=e[i];return r===void 0?"":String(r)}):A}const Lc={locale:()=>"en",t:(A,e)=>{const t=Uq[A]??String(A);return Kq(t,e)},plural:(A,e,t)=>Lc.t(Oq(A,Tq(Lc.locale(),e)),{...t,count:e})},qq=A1(Lc);function Al(){return Pe(qq)}const Jq=new Set(["png","jpg","jpeg","gif","webp","avif","bmp","ico","tif","tiff","heic"]),Hq=new Set(["mp3","wav","ogg","m4a","aac","flac","opus"]);function el(A){if(!(!A||typeof A!="object"))return A}function $0(A){if(!A)return;const e=A.split(";",1)[0]?.trim().toLowerCase();if(e)return e==="audio/x-aac"?"audio/aac":e==="audio/x-m4a"?"audio/mp4":e}function Yq(A){if(!A)return"";const e=A.lastIndexOf(".");return e===-1?"":A.slice(e+1).toLowerCase()}function Pq(A){const e=Yq(A);if(e==="svg")return"svg";if(Jq.has(e))return"image";if(Hq.has(e))return"audio"}function Vq(A){return el(A)?.type==="binary"}function jq(A,e){if(e==="svg")return A.startsWith("data:image/svg+xml")?A:void 0;if(e==="image")return A.startsWith("data:image/")?A:void 0;if(A.startsWith("data:audio/x-aac;"))return A.replace("data:audio/x-aac;","data:audio/aac;");if(A.startsWith("data:audio/x-m4a;"))return A.replace("data:audio/x-m4a;","data:audio/mp4;");if(A.startsWith("data:audio/"))return A}function hg(A,e){if(!A)return;if(typeof A=="string")return jq(A,e);const t=el(A);if(!t||typeof t.content!="string")return;const n=$0(typeof t.mimeType=="string"?t.mimeType:void 0);if(n){if(e==="svg")return n!=="image/svg+xml"?void 0:t.encoding==="base64"?`data:image/svg+xml;base64,${t.content}`:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t.content)}`;if(!(e==="image"&&!n.startsWith("image/"))&&!(e==="audio"&&!n.startsWith("audio/"))&&t.encoding==="base64")return`data:${n};base64,${t.content}`}}function zq(A){if(typeof atob=="function")try{const e=atob(A),t=Uint8Array.from(e,n=>n.charCodeAt(0));return typeof TextDecoder=="function"?new TextDecoder().decode(t):e}catch{}}function $q(A){const e=el(A);if(!(!e||typeof e.content!="string"||$0(typeof e.mimeType=="string"?e.mimeType:void 0)!=="image/svg+xml"))return e.encoding==="base64"?zq(e.content):e.content}function Ig(A){if(typeof A=="string")return A.length>0;const e=el(A);return e?typeof e.content=="string"&&e.content.length>0:!1}var Wq=k('<div class="flex min-h-56 flex-col items-center justify-center gap-2 px-6 py-10 text-center"><div class="text-14-semibold text-text-strong"></div><div class="text-14-regular text-text-weak">'),is=k('<div class="flex min-h-40 items-center justify-center px-6 py-4 text-center text-text-weak">'),Zq=k('<div class="flex justify-center bg-background-stronger px-6 py-4"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">'),Xq=k('<div class="flex justify-center bg-background-stronger px-6 py-4"><audio class="w-full max-w-xl"controls preload=metadata><source>'),AJ=k('<div class="flex flex-col gap-4 px-6 py-4">'),eJ=k('<div class="flex justify-center"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">');function tJ(A,e){return A.current!==void 0?A.current:A.after??A.before}function _E(A){const e=Al(),t=()=>A.media,n=R(()=>{const u=t();if(!(!u||u.mode==="off"))return Pq(u.path)}),i=R(()=>{const u=t();return!u||u.mode==="off"||n()?!1:Vq(u.current)}),r=()=>A.media?.onLoad?.(),o=R(()=>{const u=t(),p=n();return!u||!p?!1:u.deleted?!0:p==="svg"||u.current!==void 0?!1:!Ig(u.after)&&Ig(u.before)}),s=R(()=>{const u=t(),p=n();if(!(!u||p!=="image"&&p!=="audio"))return hg(tJ(u,p),p)}),a=R(()=>{const u=t(),p=n();if(!(!u||p!=="image"&&p!=="audio")&&u.current===void 0&&!o()&&!s()&&!(!u.path||!u.readFile))return{key:`${p}:${u.path}`,kind:p,path:u.path,readFile:u.readFile,onError:u.onError}}),[l]=et(a,async u=>u.readFile(u.path).then(p=>{const w=hg(p,u.kind);return w?{key:u.key,src:w,mime:u.kind==="audio"?$0(p?.mimeType):void 0}:(u.onError?.({kind:u.kind}),{key:u.key,error:!0})},()=>(u.onError?.({kind:u.kind}),{key:u.key,error:!0}))),c=R(()=>{const u=a(),p=l();if(!(!u||!p||p.key!==u.key))return p}),g=R(()=>{const u=c();return s()??(u&&"src"in u?u.src:void 0)}),d=R(()=>s()?"ready":a()?l.loading?"loading":c()?.error?"error":g()?"ready":"idle":"idle"),Q=R(()=>{const u=c();return u&&"mime"in u?u.mime:void 0}),B=R(()=>{const u=t();if(!(!u||n()!=="svg"))return $q(u.current)}),C=R(()=>{const u=t();if(!(!u||n()!=="svg"))return hg(u.current,"svg")}),I=R(()=>{const u=t();if(!(!u||n()!=="svg")&&B()===void 0&&Ig(u.current))return[u.path,u.current]});iA(B1(I,u=>{u&&t()?.onError?.({kind:"svg"})},{defer:!0}));const f=u=>e.t(u==="image"?"ui.fileMedia.kind.image":"ui.fileMedia.kind.audio");return E(Mr,{get children(){return[E(Te,{get when(){return n()==="image"||n()==="audio"},get children(){return E(H,{get when(){return g()},get fallback(){const u=t(),p=n();if(!u||p!=="image"&&p!=="audio")return A.fallback();const w=f(p);return o()?(()=>{var m=is();return h(m,()=>e.t("ui.fileMedia.state.removed",{kind:w})),m})():d()==="loading"?(()=>{var m=is();return h(m,()=>e.t("ui.fileMedia.state.loading",{kind:w})),m})():d()==="error"?(()=>{var m=is();return h(m,()=>e.t("ui.fileMedia.state.error",{kind:w})),m})():(()=>{var m=is();return h(m,()=>e.t("ui.fileMedia.state.unavailable",{kind:w})),m})()},children:u=>{const p=n();return p!=="image"&&p!=="audio"?A.fallback():p==="image"?(()=>{var w=Zq(),m=w.firstChild;return m.addEventListener("load",r),Y(y=>{var M=u(),v=t()?.path;return M!==y.e&&V(m,"src",y.e=M),v!==y.t&&V(m,"alt",y.t=v),y},{e:void 0,t:void 0}),w})():(()=>{var w=Xq(),m=w.firstChild,y=m.firstChild;return m.addEventListener("loadedmetadata",r),Y(M=>{var v=u(),N=Q();return v!==M.e&&V(y,"src",M.e=v),N!==M.t&&V(y,"type",M.t=N),M},{e:void 0,t:void 0}),w})()}})}}),E(Te,{get when(){return n()==="svg"},get children(){return B()===void 0&&C()==null?A.fallback():(()=>{var u=AJ();return h(u,E(H,{get when(){return B()!==void 0},get children(){return A.fallback()}}),null),h(u,E(H,{get when(){return C()},children:p=>(()=>{var w=eJ(),m=w.firstChild;return m.addEventListener("load",r),Y(y=>{var M=p(),v=t()?.path;return M!==y.e&&V(m,"src",y.e=M),v!==y.t&&V(m,"alt",y.t=v),y},{e:void 0,t:void 0}),w})()}),null),u})()}}),E(Te,{get when(){return i()},get children(){var u=Wq(),p=u.firstChild,w=p.nextSibling;return h(p,()=>t()?.path?.split("/").pop()??e.t("ui.fileMedia.binary.title")),h(w,()=>{const m=t()?.path;return m?e.t("ui.fileMedia.binary.description.path",{path:m}):e.t("ui.fileMedia.binary.description.default")}),u}}),E(Te,{when:!0,get children(){return A.fallback()}})]}})}var nJ=k('<div class="fixed z-50 flex h-8 items-center gap-2 rounded-md border border-border-base bg-background-base px-3 shadow-md"><input class="w-40 bg-transparent outline-none text-14-regular text-text-strong placeholder:text-text-weak"><div class="shrink-0 text-12-regular text-text-weak tabular-nums text-right"style=width:10ch></div><div class="flex items-center"><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong disabled:opacity-40 disabled:pointer-events-none"></button><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong disabled:opacity-40 disabled:pointer-events-none"></button></div><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong">');function iJ(A){const e=Al();return E(pC,{get children(){var t=nJ(),n=t.firstChild,i=n.nextSibling,r=i.nextSibling,o=r.firstChild,s=o.nextSibling,a=r.nextSibling;t.$$pointerdown=c=>c.stopPropagation(),h(t,E(ai,{name:"magnifying-glass",size:"small",class:"text-text-weak shrink-0"}),n),n.$$keydown=c=>A.onKeyDown(c),n.$$input=c=>A.onInput(c.currentTarget.value);var l=A.setInput;return typeof l=="function"?Xe(l,n):A.setInput=n,h(i,(()=>{var c=IA(()=>!!A.count());return()=>c()?`${A.index()+1}/${A.count()}`:"0/0"})()),zA(o,"click",A.onPrev,!0),h(o,E(ai,{name:"chevron-down",size:"small",class:"rotate-180"})),zA(s,"click",A.onNext,!0),h(s,E(ai,{name:"chevron-down",size:"small"})),zA(a,"click",A.onClose,!0),h(a,E(ai,{name:"close-small",size:"small"})),Y(c=>{var g=`${A.pos().top}px`,d=`${A.pos().right}px`,Q=e.t("ui.fileSearch.placeholder"),B=A.count()===0,C=e.t("ui.fileSearch.previousMatch"),I=A.count()===0,f=e.t("ui.fileSearch.nextMatch"),u=e.t("ui.fileSearch.close");return g!==c.e&&Qt(t,"top",c.e=g),d!==c.t&&Qt(t,"right",c.t=d),Q!==c.a&&V(n,"placeholder",c.a=Q),B!==c.o&&(o.disabled=c.o=B),C!==c.i&&V(o,"aria-label",c.i=C),I!==c.n&&(s.disabled=c.n=I),f!==c.s&&V(s,"aria-label",c.s=f),u!==c.h&&V(a,"aria-label",c.h=u),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),Y(()=>n.value=A.query()),t}})}ie(["pointerdown","input","keydown","click"]);var rJ=k('<div data-component=file class="relative outline-none"tabindex=0><div></div><div class="pointer-events-none absolute inset-0 z-0">');const oJ=5e5,sJ={...Ra,lineHeight:24,spacing:0},s4=["mode","media","class","classList","annotations","selectedLines","commentedLines","search","onLineSelected","onLineSelectionEnd","onLineNumberSelectionEnd","onRendered","preloadedDiff"],aJ=["file",...s4],lJ=["fileDiff","before","after","virtualize",...s4];function gJ(A){let e,t,n,i,r,o,s,a=!1,l=null,c=!1;const g=gq(),d=Cq(),[Q,B]=T(0),C=()=>cq(t),I=()=>t4(t),f=lq({wrapper:()=>e,overlay:()=>n,getRoot:C}),u=()=>{i===void 0&&(i=requestAnimationFrame(()=>{i=void 0;const v=c;A.updateSelection(v),c&&(c=!1,A.onLineSelectionEnd(l))}))},p=()=>{r===void 0&&(r=requestAnimationFrame(()=>{r=void 0;const v=A.buildDragSelection();v&&A.setSelectedLines(v)}))},w=v=>{if(!A.enableLineSelection()||v.button!==0)return;const N=A.lineFromMouseEvent(v);if(N.numberColumn){d.begin(!0,N.line);return}N.line!==void 0&&(d.begin(!1,N.line),o=N.line,s=N.line,a=!1,A.onDragStart(N))},m=v=>{if(!A.enableLineSelection())return;const N=A.lineFromMouseEvent(v);if(!d.track(v.buttons,N.line)&&o!==void 0){if((v.buttons&1)===0){o=void 0,s=void 0,a=!1,A.onDragReset(),d.finish();return}N.line!==void 0&&(s=N.line,a=!0,A.onDragMove(N),p())}},y=()=>{if(A.enableLineSelection()&&d.finish()!=="numbers"&&o!==void 0){if(!a){c=!1;const v=A.buildClickSelection();v&&A.setSelectedLines(v),A.onLineSelectionEnd(l),o=void 0,s=void 0,a=!1,A.onDragReset();return}c=!0,p(),u(),o=void 0,s=void 0,a=!1,A.onDragReset()}},M=()=>{if(!A.enableLineSelection()||o===void 0)return;const v=window.getSelection();!v||v.isCollapsed||u()};return F1(()=>{DA(dq(I))}),iA(()=>{Q();const v=A.commentedLines();requestAnimationFrame(()=>{const N=C();N&&A.markCommented(N,v)})}),iA(()=>{A.setSelectedLines(A.selectedLines()??null)}),iA(()=>{A.enableLineSelection()&&(tn(t,"mousedown",w),tn(t,"mousemove",m),tn(window,"mouseup",y),tn(document,"selectionchange",M))}),DA(()=>{yr(g),i!==void 0&&cancelAnimationFrame(i),r!==void 0&&cancelAnimationFrame(r),i=void 0,r=void 0,o=void 0,s=void 0,a=!1,d.reset(),l=null,c=!1}),{get wrapper(){return e},set wrapper(v){e=v},get container(){return t},set container(v){t=v},get overlay(){return n},set overlay(v){n=v},get dragStart(){return o},get dragEnd(){return s},get lastSelection(){return l},set lastSelection(v){l=v},ready:g,bridge:d,rendered:Q,setRendered:B,getRoot:C,getHost:I,find:f,scheduleSelectionUpdate:u}}function a4(A,e){return gJ({enableLineSelection:A.enableLineSelection,selectedLines:A.selectedLines,commentedLines:()=>A.commentedLines()??[],onLineSelectionEnd:A.onLineSelectionEnd,...e})}function l4(A){iA(()=>{const e=A.search();if(!e)return;const t={focus:()=>A.find.focus()};e.register(t),DA(()=>e.register(null))})}function g4(A){const e=t=>{if(!A.normalize)return t;const n=A.normalize(t);return n!==void 0?n:t};return{onLineSelected:t=>{const n=e(t);A.viewer.lastSelection=n,A.onLineSelected?.(n)},onLineSelectionEnd:t=>{const n=e(t);A.viewer.lastSelection=n,A.onLineSelectionEnd?.(n),A.viewer.bridge.consume(n)&&requestAnimationFrame(()=>A.onLineNumberSelectionEnd?.(n))}}}function c4(A){iA(()=>{A.viewer.rendered();const e=A.current();e&&(e.setLineAnnotations(A.annotations()),e.rerender(),requestAnimationFrame(()=>A.viewer.find.refresh({reset:!0})))})}function d4(A){Qq({state:A.viewer.ready,container:A.viewer.container,getRoot:A.viewer.getRoot,isReady:A.isReady,settleFrames:A.settleFrames,onReady:A.onReady})}function Q4(A){yr(A.viewer.ready);const e=A.reset===!0&&A.current!==void 0;e&&A.current?.cleanUp();const t=e||!A.current?A.create():A.current;e||!A.current?(A.viewer.container.innerHTML="",A.assign(t)):A.update?.(t),A.draw(t),Sc(A.viewer.getHost()),A.viewer.setRendered(n=>n+1),A.onReady()}function cJ(A){const e=B4(A.wrapper);if(!e)return()=>{};const t=A.container.getBoundingClientRect().height;if(!t)return()=>{};const n=A.wrapper.getBoundingClientRect().top-e.getBoundingClientRect().top,i=A.container.style.minHeight;A.container.style.minHeight=`${Math.ceil(t)}px`;let r=!1;return()=>{if(r)return;r=!0,A.container.style.minHeight=i;const s=A.wrapper.getBoundingClientRect().top-e.getBoundingClientRect().top-n;s&&(e.scrollTop+=s)}}function B4(A){let e=A.parentElement;for(;e;){const t=getComputedStyle(e);if(t.overflowY==="auto"||t.overflowY==="scroll")return e;e=e.parentElement}}function dJ(A,e){let t,n;const i=()=>{t?.cleanUp(),t=void 0,n=void 0};return{get:()=>{if(!e()){i();return}if(typeof document>"u")return;const r=A();if(!r)return;const o=B4(r)??document;return t&&n===o||(i(),t=new $f,n=o,t.setup(o,o instanceof Document?void 0:r)),t},cleanup:i}}function QJ(A,e){let t;const n=()=>{t?.release(),t=void 0};return{get:()=>{if(!e()){n();return}if(t)return t.virtualizer;const i=A();if(!i)return;const r=mq(i);if(r)return t=r,r.virtualizer},cleanup:n}}function BJ(A){if(!A.dataset.line)return;const e=parseInt(A.dataset.line,10);if(!Number.isNaN(e))return e}function E4(A,e,t){const n=A.composedPath();let i=!1,r,o;for(const s of n)if(s instanceof HTMLElement&&(i=i||s.dataset.columnNumber!=null,r===void 0&&(r=e(s)),o===void 0&&t&&(o=t(s)),i&&r!==void 0&&(t==null||o!==void 0)))break;return{line:r,numberColumn:i,side:o}}function EJ(A){const e=A.dataset.lineType;if(e==="change-deletion")return"deletions";if(e==="change-addition"||e==="change-additions")return"additions";if(A.dataset.code!=null)return A.hasAttribute("data-deletions")?"deletions":"additions"}function CJ(A){const e=Xa(A);if(e)return Zf(e)}function C4(A){return(()=>{var e=rJ(),t=e.firstChild,n=t.nextSibling;return zA(e,"focus",A.viewer.find.onFocus),zA(e,"pointerdown",A.viewer.find.onPointerDown,!0),Xe(i=>A.viewer.wrapper=i,e),h(e,E(H,{get when(){return A.viewer.find.open()},get children(){return E(iJ,{get pos(){return A.viewer.find.pos},get query(){return A.viewer.find.query},get count(){return A.viewer.find.count},get index(){return A.viewer.find.index},get setInput(){return A.viewer.find.setInput},get onInput(){return A.viewer.find.setQuery},get onKeyDown(){return A.viewer.find.onInputKeyDown},get onClose(){return A.viewer.find.close},onPrev:()=>A.viewer.find.next(-1),onNext:()=>A.viewer.find.next(1)})}}),t),Xe(i=>A.viewer.container=i,t),Xe(i=>A.viewer.overlay=i,n),Y(i=>{var r=A.mode,o=Wf,s={...A.classList,[A.class??""]:!!A.class};return r!==i.e&&V(e,"data-mode",i.e=r),i.t=ro(e,o,i.t),i.a=vi(e,s,i.a),i},{e:void 0,t:void 0,a:void 0}),e})()}function uJ(A){let e,t;const[n,i]=MA(A,aJ),r=()=>{const f=n.file.contents;return typeof f=="string"?f:Array.isArray(f)?f.join(`
|
|
810
810
|
`):f==null?"":String(f)},o=()=>{const f=r(),u=f.split(`
|
|
811
811
|
`).length-(f.endsWith(`
|
|
812
812
|
`)?1:0);return Math.max(1,u)},s=R(()=>{const f=n.file.contents;return typeof f=="string"?f.length:Array.isArray(f)?f.reduce((u,p)=>u+(typeof p=="string"?p.length+1:String(p).length+1),0):f==null?0:String(f).length}),a=R(()=>s()>oJ),l=dJ(()=>t.wrapper,a),c=f=>E4(f,BJ),g=f=>{const u=e;if(!u)return!1;if(a())return u.setSelectedLines(f),!0;const p=t.getRoot();if(!p)return!1;const w=o();if(p.querySelectorAll("[data-line]").length<w)return!1;if(!f)return u.setSelectedLines(null),!0;const m=Math.min(f.start,f.end),y=Math.max(f.start,f.end);if(m<1||y>w||!p.querySelector(`[data-line="${m}"]`)||!p.querySelector(`[data-line="${y}"]`))return u.setSelectedLines(null),!0;const M=f.endSide!=null?{start:f.start,end:f.end}:f.side!=="deletions"||p.querySelector("[data-deletions]")!=null?f:{start:f.start,end:f.end};return u.setSelectedLines(M),!0},d=f=>{t.lastSelection=f,g(f)};t=a4({enableLineSelection:()=>A.enableLineSelection===!0,selectedLines:()=>n.selectedLines,commentedLines:()=>n.commentedLines,onLineSelectionEnd:f=>n.onLineSelectionEnd?.(f)},{lineFromMouseEvent:c,setSelectedLines:d,updateSelection:f=>{const u=t.getRoot();if(!u)return;const p=i4({root:u,lineForNode:uq,sideForNode:hq,preserveTextSelection:f});p&&(d(p.range),!(!f||!p.text)&&n4(u,p.text))},buildDragSelection:()=>{if(!(t.dragStart===void 0||t.dragEnd===void 0))return{start:Math.min(t.dragStart,t.dragEnd),end:Math.max(t.dragStart,t.dragEnd)}},buildClickSelection:()=>{if(t.dragStart!==void 0)return{start:t.dragStart,end:t.dragStart}},onDragStart:()=>{},onDragMove:()=>{},onDragReset:()=>{},markCommented:rq});const B=g4({viewer:t,onLineSelected:f=>n.onLineSelected?.(f),onLineSelectionEnd:f=>n.onLineSelectionEnd?.(f),onLineNumberSelectionEnd:f=>n.onLineNumberSelectionEnd?.(f)}),C=R(()=>({...z0("unified"),...i,...B})),I=()=>{d4({viewer:t,isReady:f=>a()?f.querySelector("[data-line]")!=null:f.querySelectorAll("[data-line]").length>=o(),onReady:()=>{g(t.lastSelection),t.find.refresh({reset:!0}),n.onRendered?.()}})};return l4({search:()=>n.search,find:t.find}),iA(()=>{const f=C(),u=ga("unified"),p=l.get();Q4({viewer:t,current:e,reset:e!==void 0,create:()=>p?new KO(f,p,sJ,u):new qf(f,u),assign:w=>{e=w},draw:w=>{const m=r();w.render({file:typeof n.file.contents=="string"?n.file:{...n.file,contents:m},lineAnnotations:[],containerWrapper:t.container})},onReady:I})}),c4({viewer:t,current:()=>e,annotations:()=>n.annotations??[]}),DA(()=>{e?.cleanUp(),e=void 0,l.cleanup()}),E(C4,{mode:"text",viewer:t,get class(){return n.class},get classList(){return n.classList}})}function hJ(A){let e,t,n,i,r,o,s,a,l,c;const[g,d]=MA(A,lJ),Q=OC("(max-width: 640px)"),B=M=>E4(M,bE,EJ),C=(M,v)=>{const N=e;if(!N)return;const _=mE(c.getRoot(),M);if(_===void 0){c.lastSelection=M;return}c.lastSelection=_,N.setSelectedLines(_),n4(v?.root,v?.text)};c=a4({enableLineSelection:()=>A.enableLineSelection===!0,selectedLines:()=>g.selectedLines,commentedLines:()=>g.commentedLines,onLineSelectionEnd:M=>g.onLineSelectionEnd?.(M)},{lineFromMouseEvent:B,setSelectedLines:C,updateSelection:M=>{const v=c.getRoot();if(!v)return;const N=i4({root:v,lineForNode:bE,sideForNode:CJ,preserveTextSelection:M});if(N){if(N.text){C(N.range,{root:v,text:N.text});return}C(N.range)}},buildDragSelection:()=>{if(c.dragStart===void 0||c.dragEnd===void 0)return;const M={start:c.dragStart,end:c.dragEnd};return a&&(M.side=a),l&&a&&l!==a&&(M.endSide=l),M},buildClickSelection:()=>{if(c.dragStart===void 0)return;const M={start:c.dragStart,end:c.dragStart};return a&&(M.side=a),M},onDragStart:M=>{a=M.side,l=M.side},onDragMove:M=>{l=M.side},onDragReset:()=>{a=void 0,l=void 0},markCommented:iq});const f=QJ(()=>c.container,()=>g.virtualize!==!1),u=R(()=>{if(g.fileDiff){const N=g.fileDiff.deletionLines.join(""),_=g.fileDiff.additionLines.join("");return Math.max(N.length,_.length)>5e5}const M=typeof g.before?.contents=="string"?g.before.contents:"",v=typeof g.after?.contents=="string"?g.after.contents:"";return Math.max(M.length,v.length)>5e5}),p={lineDiffType:"none",maxLineDiffLength:0,tokenizeMaxLineLength:1},w=g4({viewer:c,normalize:M=>mE(c.getRoot(),M),onLineSelected:M=>g.onLineSelected?.(M),onLineSelectionEnd:M=>g.onLineSelectionEnd?.(M),onLineNumberSelectionEnd:M=>g.onLineNumberSelectionEnd?.(M)}),m=R(()=>{const M={...z0(A.diffStyle),...d,...w},v=u()?{...M,...p}:M;return Q()?{...v,disableLineNumbers:!0}:v}),y=M=>{d4({viewer:c,isReady:v=>v.querySelector("[data-line]")!=null,settleFrames:1,onReady:()=>{M?.(),C(c.lastSelection),c.find.refresh({reset:!0}),g.onRendered?.()}})};return l4({search:()=>g.search,find:c.find}),iA(()=>{const M=m(),v=u()?ga("unified"):ga(A.diffStyle),N=f.get(),_=typeof g.before?.contents=="string"?g.before.contents:"",F=typeof g.after?.contents=="string"?g.after.contents:"",x=cJ(c);DA(x);const S=j=>u()?WQ(j):WQ(j,j.length),G=g.before?{...g.before,contents:_,cacheKey:S(_)}:void 0,K=g.after?{...g.after,contents:F,cacheKey:S(F)}:void 0,q=g.fileDiff!==void 0?r!==g.fileDiff:r!==void 0||G===void 0||K===void 0||o===void 0||s===void 0||!Ct(o,G)||!Ct(s,K),J=e!==void 0&&(t!==N||n!==v||N!==void 0&&(i!==M.hunkSeparators||q)),P=!J&&e!==void 0&&!b0(e.options,M);Q4({viewer:c,current:e,reset:J,create:()=>N?new KK(M,N,Iq,v):new j0(M,v),update:j=>j.setOptions(M),assign:j=>{e=j,t=N,n=v,i=N?M.hunkSeparators:void 0,r=g.fileDiff,o=G,s=K},draw:j=>{if(g.fileDiff){j.render({fileDiff:g.fileDiff,forceRender:P,lineAnnotations:[],containerWrapper:c.container});return}!G||!K||j.render({oldFile:G,newFile:K,forceRender:P,lineAnnotations:[],containerWrapper:c.container})},onReady:()=>y(x)})}),c4({viewer:c,current:()=>e,annotations:()=>g.annotations??[]}),DA(()=>{e?.cleanUp(),e=void 0,t=void 0,n=void 0,i=void 0,r=void 0,o=void 0,s=void 0,f.cleanup(),a=void 0,l=void 0}),E(C4,{mode:"diff",viewer:c,get class(){return g.class},get classList(){return g.classList}})}function u4(A){return A.mode==="text"?E(_E,{get media(){return A.media},fallback:()=>uJ(A)}):E(_E,{get media(){return A.media},fallback:()=>hJ(A)})}ie(["pointerdown"]);const IJ=RC({name:"FileComponent",init:A=>A.component}),fJ=IJ.provider;function h4(A){let e=A.startIndex??0;const t=A.startLevel??0,n=[],i=a=>{if(a==null)return"";const l=A.getKey??"key",c=ii(l)?a[l]:l(a);return c!=null?String(c):""},r=a=>{if(a==null)return"";const l=A.getTextValue??"textValue",c=ii(l)?a[l]:l(a);return c!=null?String(c):""},o=a=>{if(a==null)return!1;const l=A.getDisabled??"disabled";return(ii(l)?a[l]:l(a))??!1},s=a=>{if(a!=null)return ii(A.getSectionChildren)?a[A.getSectionChildren]:A.getSectionChildren?.(a)};for(const a of A.dataSource){if(ii(a)||$y(a)){n.push({type:"item",rawValue:a,key:String(a),textValue:String(a),disabled:o(a),level:t,index:e}),e++;continue}if(s(a)!=null){n.push({type:"section",rawValue:a,key:"",textValue:"",disabled:!1,level:t,index:e}),e++;const l=s(a)??[];if(l.length>0){const c=h4({dataSource:l,getKey:A.getKey,getTextValue:A.getTextValue,getDisabled:A.getDisabled,getSectionChildren:A.getSectionChildren,startIndex:e,startLevel:t+1});n.push(...c),e+=c.length}}else n.push({type:"item",rawValue:a,key:i(a),textValue:r(a),disabled:o(a),level:t,index:e}),e++}return n}function pJ(A,e=[]){return R(()=>{const t=h4({dataSource:rA(A.dataSource),getKey:rA(A.getKey),getTextValue:rA(A.getTextValue),getDisabled:rA(A.getDisabled),getSectionChildren:rA(A.getSectionChildren)});for(let n=0;n<e.length;n++)e[n]();return A.factory(t)})}function tl(A){const[e,t]=T(A.defaultValue?.()),n=R(()=>A.value?.()!==void 0),i=R(()=>n()?A.value?.():e());return[i,o=>{le(()=>{const s=Ky(o,i());return Object.is(s,i())||(n()||t(s),A.onChange?.(s)),s})}]}function mJ(A){const[e,t]=tl(A);return[()=>e()??!1,t]}function wJ(A){const[e,t]=tl(A);return[()=>e()??[],t]}var Lt=class I4 extends Set{anchorKey;currentKey;constructor(e,t,n){super(e),e instanceof I4?(this.anchorKey=t||e.anchorKey,this.currentKey=n||e.currentKey):(this.anchorKey=t,this.currentKey=n)}};function yJ(A){const[e,t]=tl(A);return[()=>e()??new Lt,t]}function f4(A){return t2()?A.altKey:A.ctrlKey}function si(A){return zc()?A.metaKey:A.ctrlKey}function FE(A){return new Lt(A)}function DJ(A,e){if(A.size!==e.size)return!1;for(const t of A)if(!e.has(t))return!1;return!0}function kJ(A){const e=me({selectionMode:"none",selectionBehavior:"toggle"},A),[t,n]=T(!1),[i,r]=T(),o=R(()=>{const C=rA(e.selectedKeys);return C!=null?FE(C):C}),s=R(()=>{const C=rA(e.defaultSelectedKeys);return C!=null?FE(C):new Lt}),[a,l]=yJ({value:o,defaultValue:s,onChange:C=>e.onSelectionChange?.(C)}),[c,g]=T(rA(e.selectionBehavior)),d=()=>rA(e.selectionMode),Q=()=>rA(e.disallowEmptySelection)??!1,B=C=>{(rA(e.allowDuplicateSelectionEvents)||!DJ(C,a()))&&l(C)};return iA(()=>{const C=a();rA(e.selectionBehavior)==="replace"&&c()==="toggle"&&typeof C=="object"&&C.size===0&&g("replace")}),iA(()=>{g(rA(e.selectionBehavior)??"toggle")}),{selectionMode:d,disallowEmptySelection:Q,selectionBehavior:c,setSelectionBehavior:g,isFocused:t,setFocused:n,focusedKey:i,setFocusedKey:r,selectedKeys:a,setSelectedKeys:B}}function bJ(A){const[e,t]=T(""),[n,i]=T(-1);return{typeSelectHandlers:{onKeyDown:o=>{if(rA(A.isDisabled))return;const s=rA(A.keyboardDelegate),a=rA(A.selectionManager);if(!s.getKeyForSearch)return;const l=vJ(o.key);if(!l||o.ctrlKey||o.metaKey)return;l===" "&&e().trim().length>0&&(o.preventDefault(),o.stopPropagation());let c=t(d=>d+l),g=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c);g==null&&MJ(c)&&(c=c[0],g=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c)),g!=null&&(a.setFocusedKey(g),A.onTypeSelect?.(g)),clearTimeout(n()),i(window.setTimeout(()=>t(""),500))}}}}function vJ(A){return A.length===1||!/^[A-Z]/i.test(A)?A:""}function MJ(A){return A.split("").every(e=>e===A[0])}function NJ(A,e,t){const i=fA({selectOnFocus:()=>rA(A.selectionManager).selectionBehavior()==="replace"},A),r=()=>e(),{direction:o}=o4();let s={top:0,left:0};Hy(()=>rA(i.isVirtualized)?void 0:r(),"scroll",()=>{const I=r();I&&(s={top:I.scrollTop,left:I.scrollLeft})});const{typeSelectHandlers:a}=bJ({isDisabled:()=>rA(i.disallowTypeAhead),keyboardDelegate:()=>rA(i.keyboardDelegate),selectionManager:()=>rA(i.selectionManager)}),l=()=>rA(i.orientation)??"vertical",c=I=>{Z1(I,a.onKeyDown),I.altKey&&I.key==="Tab"&&I.preventDefault();const f=e();if(!f?.contains(I.target))return;const u=rA(i.selectionManager),p=rA(i.selectOnFocus),w=v=>{v!=null&&(u.setFocusedKey(v),I.shiftKey&&u.selectionMode()==="multiple"?u.extendSelection(v):p&&!f4(I)&&u.replaceSelection(v))},m=rA(i.keyboardDelegate),y=rA(i.shouldFocusWrap),M=u.focusedKey();switch(I.key){case(l()==="vertical"?"ArrowDown":"ArrowRight"):{if(m.getKeyBelow){I.preventDefault();let v;M!=null?v=m.getKeyBelow(M):v=m.getFirstKey?.(),v==null&&y&&(v=m.getFirstKey?.(M)),w(v)}break}case(l()==="vertical"?"ArrowUp":"ArrowLeft"):{if(m.getKeyAbove){I.preventDefault();let v;M!=null?v=m.getKeyAbove(M):v=m.getLastKey?.(),v==null&&y&&(v=m.getLastKey?.(M)),w(v)}break}case(l()==="vertical"?"ArrowLeft":"ArrowUp"):{if(m.getKeyLeftOf){I.preventDefault();const v=o()==="rtl";let N;M!=null?N=m.getKeyLeftOf(M):N=v?m.getFirstKey?.():m.getLastKey?.(),w(N)}break}case(l()==="vertical"?"ArrowRight":"ArrowDown"):{if(m.getKeyRightOf){I.preventDefault();const v=o()==="rtl";let N;M!=null?N=m.getKeyRightOf(M):N=v?m.getLastKey?.():m.getFirstKey?.(),w(N)}break}case"Home":if(m.getFirstKey){I.preventDefault();const v=m.getFirstKey(M,si(I));v!=null&&(u.setFocusedKey(v),si(I)&&I.shiftKey&&u.selectionMode()==="multiple"?u.extendSelection(v):p&&u.replaceSelection(v))}break;case"End":if(m.getLastKey){I.preventDefault();const v=m.getLastKey(M,si(I));v!=null&&(u.setFocusedKey(v),si(I)&&I.shiftKey&&u.selectionMode()==="multiple"?u.extendSelection(v):p&&u.replaceSelection(v))}break;case"PageDown":if(m.getKeyPageBelow&&M!=null){I.preventDefault();const v=m.getKeyPageBelow(M);w(v)}break;case"PageUp":if(m.getKeyPageAbove&&M!=null){I.preventDefault();const v=m.getKeyPageAbove(M);w(v)}break;case"a":si(I)&&u.selectionMode()==="multiple"&&rA(i.disallowSelectAll)!==!0&&(I.preventDefault(),u.selectAll());break;case"Escape":I.defaultPrevented||(I.preventDefault(),rA(i.disallowEmptySelection)||u.clearSelection());break;case"Tab":if(!rA(i.allowsTabNavigation)){if(I.shiftKey)f.focus();else{const v=c2(f,{tabbable:!0});let N,_;do _=v.lastChild(),_&&(N=_);while(_);N&&!N.contains(document.activeElement)&&gs(N)}break}}},g=I=>{const f=rA(i.selectionManager),u=rA(i.keyboardDelegate),p=rA(i.selectOnFocus);if(f.isFocused()){I.currentTarget.contains(I.target)||f.setFocused(!1);return}if(I.currentTarget.contains(I.target)){if(f.setFocused(!0),f.focusedKey()==null){const w=y=>{y!=null&&(f.setFocusedKey(y),p&&f.replaceSelection(y))},m=I.relatedTarget;m&&I.currentTarget.compareDocumentPosition(m)&Node.DOCUMENT_POSITION_FOLLOWING?w(f.lastSelectedKey()??u.getLastKey?.()):w(f.firstSelectedKey()??u.getFirstKey?.())}else if(!rA(i.isVirtualized)){const w=r();if(w){w.scrollTop=s.top,w.scrollLeft=s.left;const m=w.querySelector(`[data-key="${f.focusedKey()}"]`);m&&(gs(m),qd(w,m))}}}},d=I=>{const f=rA(i.selectionManager);I.currentTarget.contains(I.relatedTarget)||f.setFocused(!1)},Q=I=>{r()===I.target&&I.preventDefault()},B=()=>{const I=rA(i.autoFocus);if(!I)return;const f=rA(i.selectionManager),u=rA(i.keyboardDelegate);let p;I==="first"&&(p=u.getFirstKey?.()),I==="last"&&(p=u.getLastKey?.());const w=f.selectedKeys();w.size&&(p=w.values().next().value),f.setFocused(!0),f.setFocusedKey(p);const m=e();m&&p==null&&!rA(i.shouldUseVirtualFocus)&&gs(m)};return F1(()=>{i.deferAutoFocus?setTimeout(B,0):B()}),iA(B1([r,()=>rA(i.isVirtualized),()=>rA(i.selectionManager).focusedKey()],I=>{const[f,u,p]=I;if(u)p&&i.scrollToKey?.(p);else if(p&&f){const w=f.querySelector(`[data-key="${p}"]`);w&&qd(f,w)}})),{tabIndex:R(()=>{if(!rA(i.shouldUseVirtualFocus))return rA(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:Q,onFocusIn:g,onFocusOut:d}}function SJ(A,e){const t=()=>rA(A.selectionManager),n=()=>rA(A.key),i=()=>rA(A.shouldUseVirtualFocus),r=u=>{t().selectionMode()!=="none"&&(t().selectionMode()==="single"?t().isSelected(n())&&!t().disallowEmptySelection()?t().toggleSelection(n()):t().replaceSelection(n()):u?.shiftKey?t().extendSelection(n()):t().selectionBehavior()==="toggle"||si(u)||"pointerType"in u&&u.pointerType==="touch"?t().toggleSelection(n()):t().replaceSelection(n()))},o=()=>t().isSelected(n()),s=()=>rA(A.disabled)||t().isDisabled(n()),a=()=>!s()&&t().canSelectItem(n());let l=null;const c=u=>{a()&&(l=u.pointerType,u.pointerType==="mouse"&&u.button===0&&!rA(A.shouldSelectOnPressUp)&&r(u))},g=u=>{a()&&u.pointerType==="mouse"&&u.button===0&&rA(A.shouldSelectOnPressUp)&&rA(A.allowsDifferentPressOrigin)&&r(u)},d=u=>{a()&&(rA(A.shouldSelectOnPressUp)&&!rA(A.allowsDifferentPressOrigin)||l!=="mouse")&&r(u)},Q=u=>{!a()||!["Enter"," "].includes(u.key)||(f4(u)?t().toggleSelection(n()):r(u))},B=u=>{s()&&u.preventDefault()},C=u=>{const p=e();i()||s()||!p||u.target===p&&t().setFocusedKey(n())},I=R(()=>{if(!(i()||s()))return n()===t().focusedKey()?0:-1}),f=R(()=>rA(A.virtualized)?void 0:n());return iA(B1([e,n,i,()=>t().focusedKey(),()=>t().isFocused()],([u,p,w,m,y])=>{u&&p===m&&y&&!w&&document.activeElement!==u&&(A.focus?A.focus():gs(u))})),{isSelected:o,isDisabled:s,allowsSelection:a,tabIndex:I,dataKey:f,onPointerDown:c,onPointerUp:g,onClick:d,onKeyDown:Q,onMouseDown:B,onFocus:C}}var xJ=class{collection;state;constructor(A,e){this.collection=A,this.state=e}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(A){this.state.setSelectionBehavior(A)}isFocused(){return this.state.isFocused()}setFocused(A){this.state.setFocused(A)}focusedKey(){return this.state.focusedKey()}setFocusedKey(A){(A==null||this.collection().getItem(A))&&this.state.setFocusedKey(A)}selectedKeys(){return this.state.selectedKeys()}isSelected(A){if(this.state.selectionMode()==="none")return!1;const e=this.getKey(A);return e==null?!1:this.state.selectedKeys().has(e)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const A=this.state.selectedKeys();return this.getAllSelectableKeys().every(e=>A.has(e))}firstSelectedKey(){let A;for(const e of this.state.selectedKeys()){const t=this.collection().getItem(e),n=t?.index!=null&&A?.index!=null&&t.index<A.index;(!A||n)&&(A=t)}return A?.key}lastSelectedKey(){let A;for(const e of this.state.selectedKeys()){const t=this.collection().getItem(e),n=t?.index!=null&&A?.index!=null&&t.index>A.index;(!A||n)&&(A=t)}return A?.key}extendSelection(A){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(A);return}const e=this.getKey(A);if(e==null)return;const t=this.state.selectedKeys(),n=t.anchorKey||e,i=new Lt(t,n,e);for(const r of this.getKeyRange(n,t.currentKey||e))i.delete(r);for(const r of this.getKeyRange(e,n))this.canSelectItem(r)&&i.add(r);this.state.setSelectedKeys(i)}getKeyRange(A,e){const t=this.collection().getItem(A),n=this.collection().getItem(e);return t&&n?t.index!=null&&n.index!=null&&t.index<=n.index?this.getKeyRangeInternal(A,e):this.getKeyRangeInternal(e,A):[]}getKeyRangeInternal(A,e){const t=[];let n=A;for(;n!=null;){const i=this.collection().getItem(n);if(i&&i.type==="item"&&t.push(n),n===e)return t;n=this.collection().getKeyAfter(n)}return[]}getKey(A){const e=this.collection().getItem(A);return e?!e||e.type!=="item"?null:e.key:A}toggleSelection(A){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(A)){this.replaceSelection(A);return}const e=this.getKey(A);if(e==null)return;const t=new Lt(this.state.selectedKeys());t.has(e)?t.delete(e):this.canSelectItem(e)&&(t.add(e),t.anchorKey=e,t.currentKey=e),!(this.disallowEmptySelection()&&t.size===0)&&this.state.setSelectedKeys(t)}replaceSelection(A){if(this.selectionMode()==="none")return;const e=this.getKey(A);if(e==null)return;const t=this.canSelectItem(e)?new Lt([e],e,e):new Lt;this.state.setSelectedKeys(t)}setSelectedKeys(A){if(this.selectionMode()==="none")return;const e=new Lt;for(const t of A){const n=this.getKey(t);if(n!=null&&(e.add(n),this.selectionMode()==="single"))break}this.state.setSelectedKeys(e)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const A=this.state.selectedKeys();!this.disallowEmptySelection()&&A.size>0&&this.state.setSelectedKeys(new Lt)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(A,e){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(A)&&!this.disallowEmptySelection()?this.toggleSelection(A):this.replaceSelection(A):this.selectionBehavior()==="toggle"||e&&e.pointerType==="touch"?this.toggleSelection(A):this.replaceSelection(A))}isSelectionEqual(A){if(A===this.state.selectedKeys())return!0;const e=this.selectedKeys();if(A.size!==e.size)return!1;for(const t of A)if(!e.has(t))return!1;for(const t of e)if(!A.has(t))return!1;return!0}canSelectItem(A){if(this.state.selectionMode()==="none")return!1;const e=this.collection().getItem(A);return e!=null&&!e.disabled}isDisabled(A){const e=this.collection().getItem(A);return!e||e.disabled}getAllSelectableKeys(){const A=[];return(t=>{for(;t!=null;){if(this.canSelectItem(t)){const n=this.collection().getItem(t);if(!n)continue;n.type==="item"&&A.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),A}},GE=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(A){this.iterable=A;for(const n of A)this.keyMap.set(n.key,n);if(this.keyMap.size===0)return;let e,t=0;for(const[n,i]of this.keyMap)e?(e.nextKey=n,i.prevKey=e.key):(this.firstKey=n,i.prevKey=void 0),i.type==="item"&&(i.index=t++),e=i,e.nextKey=void 0;this.lastKey=e.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(A){return this.keyMap.get(A)?.prevKey}getKeyAfter(A){return this.keyMap.get(A)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(A){return this.keyMap.get(A)}at(A){const e=[...this.getKeys()];return this.getItem(e[A])}};function LJ(A){const e=kJ(A),n=pJ({dataSource:()=>rA(A.dataSource),getKey:()=>rA(A.getKey),getTextValue:()=>rA(A.getTextValue),getDisabled:()=>rA(A.getDisabled),getSectionChildren:()=>rA(A.getSectionChildren),factory:r=>A.filter?new GE(A.filter(r)):new GE(r)},[()=>A.filter]),i=new xJ(n,e);return vg(()=>{const r=e.focusedKey();r!=null&&!n().getItem(r)&&e.setFocusedKey(void 0)}),{collection:n,selectionManager:()=>i}}var _J=class{collection;ref;collator;constructor(A,e,t){this.collection=A,this.ref=e,this.collator=t}getKeyBelow(A){let e=this.collection().getKeyAfter(A);for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getKeyAbove(A){let e=this.collection().getKeyBefore(A);for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getFirstKey(){let A=this.collection().getFirstKey();for(;A!=null;){const e=this.collection().getItem(A);if(e&&e.type==="item"&&!e.disabled)return A;A=this.collection().getKeyAfter(A)}}getLastKey(){let A=this.collection().getLastKey();for(;A!=null;){const e=this.collection().getItem(A);if(e&&e.type==="item"&&!e.disabled)return A;A=this.collection().getKeyBefore(A)}}getItem(A){return this.ref?.()?.querySelector(`[data-key="${A}"]`)??null}getKeyPageAbove(A){const e=this.ref?.();let t=this.getItem(A);if(!e||!t)return;const n=Math.max(0,t.offsetTop+t.offsetHeight-e.offsetHeight);let i=A;for(;i&&t&&t.offsetTop>n;)i=this.getKeyAbove(i),t=i!=null?this.getItem(i):null;return i}getKeyPageBelow(A){const e=this.ref?.();let t=this.getItem(A);if(!e||!t)return;const n=Math.min(e.scrollHeight,t.offsetTop-t.offsetHeight+e.offsetHeight);let i=A;for(;i&&t&&t.offsetTop<n;)i=this.getKeyBelow(i),t=i!=null?this.getItem(i):null;return i}getKeyForSearch(A,e){const t=this.collator?.();if(!t)return;let n=e!=null?this.getKeyBelow(e):this.getFirstKey();for(;n!=null;){const i=this.collection().getItem(n);if(i){const r=i.textValue.slice(0,A.length);if(i.textValue&&t.compare(r,A)===0)return n}n=this.getKeyBelow(n)}}};function FJ(A,e,t){const n=Rq({usage:"search",sensitivity:"base"}),i=R(()=>{const r=rA(A.keyboardDelegate);return r||new _J(A.collection,e,n)});return NJ({selectionManager:()=>rA(A.selectionManager),keyboardDelegate:i,autoFocus:()=>rA(A.autoFocus),deferAutoFocus:()=>rA(A.deferAutoFocus),shouldFocusWrap:()=>rA(A.shouldFocusWrap),disallowEmptySelection:()=>rA(A.disallowEmptySelection),selectOnFocus:()=>rA(A.selectOnFocus),disallowTypeAhead:()=>rA(A.disallowTypeAhead),shouldUseVirtualFocus:()=>rA(A.shouldUseVirtualFocus),allowsTabNavigation:()=>rA(A.allowsTabNavigation),isVirtualized:()=>rA(A.isVirtualized),scrollToKey:r=>rA(A.scrollToKey)?.(r),orientation:()=>rA(A.orientation)},e)}function GJ(A={}){const[e,t]=mJ({value:()=>rA(A.open),defaultValue:()=>!!rA(A.defaultOpen),onChange:o=>A.onOpenChange?.(o)}),n=()=>{t(!0)},i=()=>{t(!1)};return{isOpen:e,setIsOpen:t,open:n,close:i,toggle:()=>{e()?i():n()}}}function ut(A){return e=>(A(e),()=>A(void 0))}var rs=A=>typeof A=="function"?A():A,RJ=A=>{const e=R(()=>{const o=rs(A.element);if(o)return getComputedStyle(o)}),t=()=>e()?.animationName??"none",[n,i]=T(rs(A.show)?"present":"hidden");let r="none";return iA(o=>{const s=rs(A.show);return le(()=>{if(o===s)return s;const a=r,l=t();s?i("present"):l==="none"||e()?.display==="none"?i("hidden"):i(o===!0&&a!==l?"hiding":"hidden")}),s}),iA(()=>{const o=rs(A.element);if(!o)return;const s=l=>{l.target===o&&(r=t())},a=l=>{const g=t().includes(l.animationName);l.target===o&&g&&n()==="hiding"&&i("hidden")};o.addEventListener("animationstart",s),o.addEventListener("animationcancel",a),o.addEventListener("animationend",a),DA(()=>{o.removeEventListener("animationstart",s),o.removeEventListener("animationcancel",a),o.removeEventListener("animationend",a)})}),{present:()=>n()==="present"||n()==="hiding",state:n,setState:i}},UJ=RJ,p4=UJ,TJ={};ha(TJ,{Collapsible:()=>OJ,Content:()=>W0,Root:()=>Z0,Trigger:()=>X0,useCollapsibleContext:()=>ho});var m4=A1();function ho(){const A=Pe(m4);if(A===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return A}function W0(A){const[e,t]=T(),n=ho(),i=me({id:n.generateId("content")},A),[r,o]=MA(i,["ref","id","style"]),{present:s}=p4({show:n.shouldMount,element:()=>e()??null}),[a,l]=T(0),[c,g]=T(0);let Q=n.isOpen()||s();return F1(()=>{const B=requestAnimationFrame(()=>{Q=!1});DA(()=>{cancelAnimationFrame(B)})}),iA(B1(s,()=>{if(!e())return;e().style.transitionDuration="0s",e().style.animationName="none";const B=e().getBoundingClientRect();l(B.height),g(B.width),Q||(e().style.transitionDuration="",e().style.animationName="")})),iA(B1(n.isOpen,B=>{!B&&e()&&(e().style.transitionDuration="",e().style.animationName="")},{defer:!0})),iA(()=>DA(n.registerContentId(r.id))),E(H,{get when(){return s()},get children(){return E(qe,fA({as:"div",ref(B){var C=it(t,r.ref);typeof C=="function"&&C(B)},get id(){return r.id},get style(){return ua({"--kb-collapsible-content-height":a()?`${a()}px`:void 0,"--kb-collapsible-content-width":c()?`${c()}px`:void 0},r.style)}},()=>n.dataset(),o))}})}function Z0(A){const e=`collapsible-${Jt()}`,t=me({id:e},A),[n,i]=MA(t,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[r,o]=T(),s=GJ({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:c=>n.onOpenChange?.(c)}),a=R(()=>({"data-expanded":s.isOpen()?"":void 0,"data-closed":s.isOpen()?void 0:"","data-disabled":n.disabled?"":void 0})),l={dataset:a,isOpen:s.isOpen,disabled:()=>n.disabled??!1,shouldMount:()=>n.forceMount||s.isOpen(),contentId:r,toggle:s.toggle,generateId:ao(()=>i.id),registerContentId:ut(o)};return E(m4.Provider,{value:l,get children(){return E(qe,fA({as:"div"},a,i))}})}function X0(A){const e=ho(),[t,n]=MA(A,["onClick"]);return E($c,fA({get"aria-expanded"(){return e.isOpen()},get"aria-controls"(){return IA(()=>!!e.isOpen())()?e.contentId():void 0},get disabled(){return e.disabled()},onClick:r=>{Z1(r,t.onClick),e.toggle()}},()=>e.dataset(),n))}var OJ=Object.assign(Z0,{Content:W0,Trigger:X0}),w4=A1();function KJ(){return Pe(w4)}function qJ(){const A=KJ();if(A===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return A}function y4(A,e){return!!(e.compareDocumentPosition(A)&Node.DOCUMENT_POSITION_PRECEDING)}function JJ(A,e){const t=e.ref();if(!t)return-1;let n=A.length;if(!n)return-1;for(;n--;){const i=A[n]?.ref();if(i&&y4(i,t))return n+1}return 0}function HJ(A){const e=A.map((n,i)=>[i,n]);let t=!1;return e.sort(([n,i],[r,o])=>{const s=i.ref(),a=o.ref();return s===a||!s||!a?0:y4(s,a)?(n>r&&(t=!0),-1):(n<r&&(t=!0),1)}),t?e.map(([n,i])=>i):A}function D4(A,e){const t=HJ(A);A!==t&&e(t)}function YJ(A){const e=A[0],t=A[A.length-1]?.ref();let n=e?.ref()?.parentElement;for(;n;){if(t&&n.contains(t))return n;n=n.parentElement}return Zy(n).body}function PJ(A,e){iA(()=>{const t=setTimeout(()=>{D4(A(),e)});DA(()=>clearTimeout(t))})}function VJ(A,e){if(typeof IntersectionObserver!="function"){PJ(A,e);return}let t=[];iA(()=>{const n=()=>{const o=!!t.length;t=A(),o&&D4(A(),e)},i=YJ(A()),r=new IntersectionObserver(n,{root:i});for(const o of A()){const s=o.ref();s&&r.observe(s)}DA(()=>r.disconnect())})}function jJ(A={}){const[e,t]=wJ({value:()=>rA(A.items),onChange:r=>A.onItemsChange?.(r)});VJ(e,t);const n=r=>(t(o=>{const s=JJ(o,r);return zy(o,r,s)}),()=>{t(o=>{const s=o.filter(a=>a.ref()!==r.ref());return o.length===s.length?o:s})});return{DomCollectionProvider:r=>E(w4.Provider,{value:{registerItem:n},get children(){return r.children}})}}function zJ(A){const e=qJ(),t=me({shouldRegisterItem:!0},A);iA(()=>{if(!t.shouldRegisterItem)return;const n=e.registerItem(t.getItem());DA(n)})}var $J={};ha($J,{Accordion:()=>Ui,Content:()=>v4,Header:()=>M4,Item:()=>S4,Root:()=>x4,Trigger:()=>L4,useAccordionContext:()=>Ad});var k4=A1();function b4(){const A=Pe(k4);if(A===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return A}function v4(A){const e=b4(),t=e.generateId("content"),n=me({id:t},A),[i,r]=MA(n,["id","style"]);return iA(()=>DA(e.registerContentId(i.id))),E(W0,fA({role:"region",get"aria-labelledby"(){return e.triggerId()},get style(){return ua({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},i.style)}},r))}function M4(A){const e=ho();return E(qe,fA({as:"h3"},()=>e.dataset(),A))}var N4=A1();function Ad(){const A=Pe(N4);if(A===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return A}function S4(A){const e=Ad(),t=`${e.generateId("item")}-${Jt()}`,n=me({id:t},A),[i,r]=MA(n,["value","disabled"]),[o,s]=T(),[a,l]=T(),c=()=>e.listState().selectionManager(),g=()=>c().isSelected(i.value),d={value:()=>i.value,triggerId:o,contentId:a,generateId:ao(()=>r.id),registerTriggerId:ut(s),registerContentId:ut(l)};return E(k4.Provider,{value:d,get children(){return E(Z0,fA({get open(){return g()},get disabled(){return i.disabled}},r))}})}function x4(A){let e;const t=`accordion-${Jt()}`,n=me({id:t,multiple:!1,collapsible:!1,shouldFocusWrap:!0},A),[i,r]=MA(n,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[o,s]=T([]),{DomCollectionProvider:a}=jJ({items:o,onItemsChange:s}),l=LJ({selectedKeys:()=>i.value,defaultSelectedKeys:()=>i.defaultValue,onSelectionChange:d=>i.onChange?.(Array.from(d)),disallowEmptySelection:()=>!i.multiple&&!i.collapsible,selectionMode:()=>i.multiple?"multiple":"single",dataSource:o});l.selectionManager().setFocusedKey("item-1");const c=FJ({selectionManager:()=>l.selectionManager(),collection:()=>l.collection(),disallowEmptySelection:()=>l.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>i.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>e),g={listState:()=>l,generateId:ao(()=>i.id)};return E(a,{get children(){return E(N4.Provider,{value:g,get children(){return E(qe,fA({as:"div",get id(){return i.id},ref(d){var Q=it(B=>e=B,i.ref);typeof Q=="function"&&Q(d)},get onKeyDown(){return _t([i.onKeyDown,c.onKeyDown])},get onMouseDown(){return _t([i.onMouseDown,c.onMouseDown])},get onFocusIn(){return _t([i.onFocusIn])},get onFocusOut(){return _t([i.onFocusOut,c.onFocusOut])}},r))}})}})}function L4(A){let e;const t=Ad(),n=b4(),i=ho(),r=n.generateId("trigger"),o=me({id:r},A),[s,a]=MA(o,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);zJ({getItem:()=>({ref:()=>e,type:"item",key:n.value(),textValue:"",disabled:i.disabled()})});const l=SJ({key:()=>n.value(),selectionManager:()=>t.listState().selectionManager(),disabled:()=>i.disabled(),shouldSelectOnPressUp:!0},()=>e),c=g=>{["Enter"," "].includes(g.key)&&g.preventDefault(),Z1(g,s.onKeyDown),Z1(g,l.onKeyDown)};return iA(()=>DA(n.registerTriggerId(a.id))),E(X0,fA({ref(g){var d=it(Q=>e=Q,s.ref);typeof d=="function"&&d(g)},get"data-key"(){return l.dataKey()},get onPointerDown(){return _t([s.onPointerDown,l.onPointerDown])},get onPointerUp(){return _t([s.onPointerUp,l.onPointerUp])},get onClick(){return _t([s.onClick,l.onClick])},onKeyDown:c,get onMouseDown(){return _t([s.onMouseDown,l.onMouseDown])},get onFocus(){return _t([s.onFocus,l.onFocus])}},a))}var Ui=Object.assign(x4,{Content:v4,Header:M4,Item:S4,Trigger:L4});function WJ(A){const[e,t]=MA(A,["class","classList"]);return E(Ui,fA(t,{"data-component":"accordion",get classList(){return{...e.classList,[e.class??""]:!!e.class}}}))}function ZJ(A){const[e,t]=MA(A,["class","classList"]);return E(Ui.Item,fA(t,{"data-slot":"accordion-item",get classList(){return{...e.classList,[e.class??""]:!!e.class}}}))}function XJ(A){const[e,t]=MA(A,["class","classList","children"]);return E(Ui.Header,fA(t,{"data-slot":"accordion-header",get classList(){return{...e.classList,[e.class??""]:!!e.class}},get children(){return e.children}}))}function AH(A){const[e,t]=MA(A,["class","classList","children"]);return E(Ui.Trigger,fA(t,{"data-slot":"accordion-trigger",get classList(){return{...e.classList,[e.class??""]:!!e.class}},get children(){return e.children}}))}function eH(A){const[e,t]=MA(A,["class","classList","children"]);return E(Ui.Content,fA(t,{"data-slot":"accordion-content",get classList(){return{...e.classList,[e.class??""]:!!e.class}},get children(){return e.children}}))}const cr=Object.assign(WJ,{Item:ZJ,Header:XJ,Trigger:AH,Content:eH});function tH(A){const[e,t]=MA(A,["variant","size","icon","class","classList"]);return E(Ia,fA(t,{"data-component":"button",get"data-size"(){return e.size||"normal"},get"data-variant"(){return e.variant||"secondary"},get"data-icon"(){return e.icon},get classList(){return{...e.classList,[e.class??""]:!!e.class}},get children(){return[E(H,{get when(){return e.icon},get children(){return E(ai,{get name(){return e.icon},size:"small"})}}),IA(()=>A.children)]}}))}var nH=k('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 14"fill=none><g>'),iH=k("<span data-slot=diff-changes-additions>"),rH=k("<span data-slot=diff-changes-deletions>"),oH=k("<div data-component=diff-changes>"),sH=k("<svg><rect width=2 height=14 rx=1></svg>",!1,!0,!1);function RE(A){const e=()=>A.variant??"default",t=R(()=>Array.isArray(A.changes)?A.changes.reduce((c,g)=>c+(g.additions??0),0):A.changes.additions),n=R(()=>Array.isArray(A.changes)?A.changes.reduce((c,g)=>c+(g.deletions??0),0):A.changes.deletions),i=R(()=>(t()??0)+(n()??0)),r=R(()=>{const g=t()??0,d=n()??0;if(g===0&&d===0)return{added:0,deleted:0,neutral:5};const Q=g+d;if(Q<5){const v=g>0?1:0,N=d>0?1:0,_=5-v-N;return{added:v,deleted:N,neutral:_}}const B=g>d?g/d:d/g;let C=5;(Q<20||B<4)&&(C=4);const I=g/Q,f=d/Q,u=I*C,p=f*C;let w=g>0?Math.max(1,Math.round(u)):0,m=d>0?Math.max(1,Math.round(p)):0;g>0&&g<=5&&(w=Math.min(w,1)),g>5&&g<=10&&(w=Math.min(w,2)),d>0&&d<=5&&(m=Math.min(m,1)),d>5&&d<=10&&(m=Math.min(m,2));let y=w+m;y>C&&(u>p?w=C-m:m=C-w,y=w+m);const M=Math.max(0,5-y);return{added:w,deleted:m,neutral:M}}),o="var(--icon-diff-add-base)",s="var(--icon-diff-delete-base)",a="var(--icon-weak-base)",l=R(()=>{const c=r();return[...Array(c.added).fill(o),...Array(c.deleted).fill(s),...Array(c.neutral).fill(a)].slice(0,5)});return E(H,{get when(){return IA(()=>e()==="default")()?i()>0:!0},get children(){var c=oH();return h(c,E(Mr,{get children(){return[E(Te,{get when(){return e()==="bars"},get children(){var g=nH(),d=g.firstChild;return h(d,E(hA,{get each(){return l()},children:(Q,B)=>(()=>{var C=sH();return V(C,"fill",Q),Y(()=>V(C,"x",B()*4)),C})()})),g}}),E(Te,{get when(){return e()==="default"},get children(){return[(()=>{var g=iH();return h(g,()=>`+${t()}`),g})(),(()=>{var g=rH();return h(g,()=>`-${n()}`),g})()]}})]}})),Y(g=>{var d=e(),Q={[A.class??""]:!0};return d!==g.e&&V(c,"data-variant",g.e=d),g.t=vi(c,Q,g.t),g},{e:void 0,t:void 0}),c}})}const UE="/console/assets/sprite-Fb-TFjRY.svg";var aH=k("<svg><defs><mask mask-type=alpha><use></svg>",!1,!0,!1),lH=k("<svg><rect width=100% height=100% fill=currentColor></svg>",!1,!0,!1),gH=k("<svg data-component=file-icon>"),cH=k("<svg><use></svg>",!1,!0,!1);const dH=A=>{const[e,t]=MA(A,["node","class","classList","expanded","mono"]),n=R(()=>uH(e.node.path,e.node.type,e.expanded||!1)),i=`file-icon-mono-${Jt()}`;return(()=>{var r=gH();return e1(r,fA(t,{get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!0,!0),h(r,E(H,{get when(){return e.mono},get fallback(){return(()=>{var o=cH();return Y(()=>V(o,"href",`${UE}#${n()}`)),o})()},get children(){return[(()=>{var o=aH(),s=o.firstChild,a=s.firstChild;return V(s,"id",i),Y(()=>V(a,"href",`${UE}#${n()}`)),o})(),(()=>{var o=lH();return V(o,"mask",`url(#${i})`),o})()]}})),r})()},ni={fileNames:{"readme.md":"Readme","changelog.md":"Changelog","contributing.md":"Contributing","conduct.md":"Conduct",license:"Certificate",authors:"Authors",credits:"Credits",install:"Installation","package.json":"Nodejs","package-lock.json":"Nodejs","yarn.lock":"Yarn","pnpm-lock.yaml":"Pnpm","bun.lock":"Bun","bun.lockb":"Bun","bunfig.toml":"Bun",".nvmrc":"Nodejs",".node-version":"Nodejs",dockerfile:"Docker","docker-compose.yml":"Docker","docker-compose.yaml":"Docker",".dockerignore":"Docker","jest.config.js":"Jest","jest.config.ts":"Jest","jest.config.mjs":"Jest","vitest.config.js":"Vitest","vitest.config.ts":"Vitest","tailwind.config.js":"Tailwindcss","tailwind.config.ts":"Tailwindcss","turbo.json":"Turborepo","tsconfig.json":"Tsconfig","jsconfig.json":"Jsconfig",".eslintrc":"Eslint",".eslintrc.js":"Eslint",".eslintrc.json":"Eslint",".prettierrc":"Prettier",".prettierrc.js":"Prettier",".prettierrc.json":"Prettier","vite.config.js":"Vite","vite.config.ts":"Vite","webpack.config.js":"Webpack","rollup.config.js":"Rollup","astro.config.mjs":"AstroConfig","astro.config.js":"AstroConfig","next.config.js":"Next","next.config.mjs":"Next","nuxt.config.js":"Nuxt","nuxt.config.ts":"Nuxt","svelte.config.js":"Svelte","gatsby-config.js":"Gatsby","remix.config.js":"Remix","prisma.schema":"Prisma",".gitignore":"Git",".gitattributes":"Git",makefile:"Makefile",cmake:"Cmake","cargo.toml":"Rust","go.mod":"GoMod","go.sum":"GoMod","requirements.txt":"Python","pyproject.toml":"Python",pipfile:"Python","poetry.lock":"Poetry",gemfile:"Gemfile",rakefile:"Ruby","composer.json":"Php","build.gradle":"Gradle","pom.xml":"Maven","deno.json":"Deno","deno.jsonc":"Deno","vercel.json":"Vercel","netlify.toml":"Netlify",".env":"Tune",".env.local":"Tune",".env.development":"Tune",".env.production":"Tune",".env.example":"Tune",".editorconfig":"Editorconfig","robots.txt":"Robots","favicon.ico":"Favicon",browserlist:"Browserlist",".babelrc":"Babel","babel.config.js":"Babel","gulpfile.js":"Gulp","gruntfile.js":"Grunt","capacitor.config.json":"Capacitor","ionic.config.json":"Ionic","angular.json":"Angular",".storybook":"Storybook","storybook.config.js":"Storybook","cypress.config.js":"Cypress","playwright.config.js":"Playwright","puppeteer.config.js":"Puppeteer","wrangler.toml":"Wrangler","firebase.json":"Firebase",supabase:"Supabase",terraform:"Terraform",kubernetes:"Kubernetes",".gitpod.yml":"Gitpod",".devcontainer":"Vscode","travis.yml":"Travis","appveyor.yml":"Appveyor",".circleci":"Circleci","renovate.json":"Renovate","dependabot.yml":"Dependabot","lerna.json":"Lerna","nx.json":"Nx"},fileExtensions:{"spec.ts":"TestTs","test.ts":"TestTs","spec.tsx":"TestJsx","test.tsx":"TestJsx","spec.js":"TestJs","test.js":"TestJs","spec.jsx":"TestJsx","test.jsx":"TestJsx","js.map":"JavascriptMap","d.ts":"TypescriptDef",ts:"Typescript",tsx:"React_ts",js:"Javascript",jsx:"React",mjs:"Javascript",cjs:"Javascript",html:"Html",htm:"Html",css:"Css",scss:"Sass",sass:"Sass",less:"Less",styl:"Stylus",json:"Json",xml:"Xml",yml:"Yaml",yaml:"Yaml",toml:"Toml",hjson:"Hjson",md:"Markdown",mdx:"Mdx",tex:"Tex",py:"Python",pyx:"Python",pyw:"Python",rs:"Rust",go:"Go",java:"Java",kt:"Kotlin",scala:"Scala",php:"Php",rb:"Ruby",cs:"Csharp",vb:"Visualstudio",cpp:"Cpp",cc:"Cpp",cxx:"Cpp",c:"C",h:"H",hpp:"Hpp",swift:"Swift",m:"ObjectiveC",mm:"ObjectiveCpp",dart:"Dart",lua:"Lua",pl:"Perl",r:"R",jl:"Julia",hs:"Haskell",elm:"Elm",ml:"Ocaml",clj:"Clojure",cljs:"Clojure",erl:"Erlang",ex:"Elixir",exs:"Elixir",nim:"Nim",zig:"Zig",v:"Vlang",odin:"Odin",gleam:"Gleam",grain:"Grain",roc:"Rocket",fs:"Fsharp",sh:"Console",bash:"Console",zsh:"Console",fish:"Console",ps1:"Powershell",cfg:"Settings",ini:"Settings",conf:"Settings",properties:"Settings",svg:"Svg",png:"Image",jpg:"Image",jpeg:"Image",gif:"Image",webp:"Image",bmp:"Image",ico:"Favicon",mp4:"Video",mov:"Video",avi:"Video",webm:"Video",mp3:"Audio",wav:"Audio",flac:"Audio",zip:"Zip",tar:"Zip",gz:"Zip",rar:"Zip","7z":"Zip",pdf:"Pdf",doc:"Word",docx:"Word",ppt:"Powerpoint",pptx:"Powerpoint",xls:"Document",xlsx:"Document",sql:"Database",db:"Database",sqlite:"Database",env:"Tune",log:"Log",lock:"Lock",key:"Key",pem:"Certificate",crt:"Certificate",proto:"Proto",graphql:"Graphql",gql:"Graphql",wasm:"Webassembly",dockerfile:"Docker"},folderNames:{src:"FolderSrc",source:"FolderSrc",lib:"FolderLib",libs:"FolderLib",test:"FolderTest",tests:"FolderTest",testing:"FolderTest",spec:"FolderTest",specs:"FolderTest",__tests__:"FolderTest",e2e:"FolderTest",integration:"FolderTest",unit:"FolderTest",cypress:"FolderCypress",node_modules:"FolderNode",vendor:"FolderPackages",packages:"FolderPackages",deps:"FolderPackages",build:"FolderBuildkite",dist:"FolderDist",out:"FolderDist",output:"FolderDist",target:"FolderTarget",config:"FolderConfig",configs:"FolderConfig",configuration:"FolderConfig",settings:"FolderConfig",env:"FolderEnvironment",environments:"FolderEnvironment",docker:"FolderDocker",dockerfiles:"FolderDocker",containers:"FolderDocker",docs:"FolderDocs",doc:"FolderDocs",documentation:"FolderDocs",readme:"FolderDocs",public:"FolderPublic",static:"FolderPublic",assets:"FolderImages",images:"FolderImages",img:"FolderImages",icons:"FolderImages",media:"FolderImages",fonts:"FolderFont",styles:"FolderCss",stylesheets:"FolderCss",css:"FolderCss",sass:"FolderSass",scss:"FolderSass",less:"FolderLess",scripts:"FolderScripts",script:"FolderScripts",tools:"FolderTools",utils:"FolderUtils",utilities:"FolderUtils",helpers:"FolderHelper",components:"FolderComponents",component:"FolderComponents",views:"FolderViews",view:"FolderViews",layouts:"FolderLayout",layout:"FolderLayout",templates:"FolderTemplate",template:"FolderTemplate",hooks:"FolderHook",hook:"FolderHook",store:"FolderStore",stores:"FolderStore",state:"FolderNgrxStore",reducers:"FolderReduxReducer",reducer:"FolderReduxReducer",services:"FolderApi",service:"FolderApi",api:"FolderApi",apis:"FolderApi",routes:"FolderRoutes",route:"FolderRoutes",routing:"FolderRoutes",middleware:"FolderMiddleware",middlewares:"FolderMiddleware",controllers:"FolderController",controller:"FolderController",models:"FolderDatabase",model:"FolderDatabase",schemas:"FolderDatabase",schema:"FolderDatabase",migrations:"FolderDatabase",migration:"FolderDatabase",seeders:"FolderSeeders",seeder:"FolderSeeders",types:"FolderTypescript",typing:"FolderTypescript",typings:"FolderTypescript","@types":"FolderTypescript",interfaces:"FolderInterface",interface:"FolderInterface",android:"FolderAndroid",ios:"FolderIos",mobile:"FolderMobile",flutter:"FolderFlutter",kubernetes:"FolderKubernetes",k8s:"FolderKubernetes",terraform:"FolderTerraform",aws:"FolderAws",azure:"FolderAzurePipelines",firebase:"FolderFirebase",supabase:"FolderSupabase",vercel:"FolderVercel",netlify:"FolderNetlify",".github":"FolderGithub",".gitlab":"FolderGitlab",".circleci":"FolderCircleci",ci:"FolderCi",".ci":"FolderCi",workflows:"FolderGhWorkflows",".git":"FolderGit",".vscode":"FolderVscode",".idea":"FolderIntellij",".cursor":"FolderCursor",".devcontainer":"FolderContainer",".storybook":"FolderStorybook",i18n:"FolderI18n",locales:"FolderI18n",locale:"FolderI18n",lang:"FolderI18n",languages:"FolderI18n",temp:"FolderTemp",tmp:"FolderTemp",logs:"FolderLog",log:"FolderLog",backup:"FolderBackup",backups:"FolderBackup",examples:"FolderExamples",example:"FolderExamples",demo:"FolderExamples",demos:"FolderExamples",samples:"FolderExamples",sample:"FolderExamples",fixtures:"FolderTest",mocks:"FolderMock",mock:"FolderMock",data:"FolderDatabase",database:"FolderDatabase",db:"FolderDatabase",sql:"FolderDatabase",prisma:"FolderPrisma",drizzle:"FolderDrizzle",security:"FolderSecure",auth:"FolderSecure",authentication:"FolderSecure",authorization:"FolderSecure",keys:"FolderKeys",certs:"FolderKeys",certificates:"FolderKeys",content:"FolderContent",posts:"FolderContent",articles:"FolderContent",blog:"FolderContent",functions:"FolderFunctions",function:"FolderFunctions",lambda:"FolderFunctions",lambdas:"FolderFunctions",serverless:"FolderServerless",jobs:"FolderJob",job:"FolderJob",tasks:"FolderTasks",task:"FolderTasks",cron:"FolderTasks",queue:"FolderQueue",queues:"FolderQueue",desktop:"FolderDesktop",windows:"FolderWindows",macos:"FolderMacos",linux:"FolderLinux"},defaults:{file:"Document",folder:"Folder",folderOpen:"FolderOpen"}},QH=A=>A.startsWith("Folder")?A.endsWith("_light")?A.replace("_light","Open_light"):A.endsWith("Open")?A:A+"Open":A,BH=A=>A.split("\\").join("/").split("/").filter(Boolean).pop()??"",EH=A=>{const e=A.toLowerCase();return[e,`.${e}`,`_${e}`,`__${e}__`]},CH=A=>{const e=A.toLowerCase(),t=[];for(let i=0;i<e.length;i++)e[i]==="."&&t.push(i);const n=new Set;n.add(e);for(const i of t)i+1<e.length&&n.add(e.slice(i+1));return Array.from(n).sort((i,r)=>r.length-i.length)};function uH(A,e,t){const i=BH(A).toLowerCase();if(e==="directory"){for(const o of EH(i)){const s=ni.folderNames[o];if(s)return t?QH(s):s}return t?ni.defaults.folderOpen:ni.defaults.folder}const r=ni.fileNames[i];if(r)return r;for(const o of CH(i)){const s=ni.fileExtensions[o];if(s)return s}return ni.defaults.file}var hH=["id","name","validationState","required","disabled","readOnly"];function IH(A){const e=`form-control-${Jt()}`,t=me({id:e},A),[n,i]=T(),[r,o]=T(),[s,a]=T(),[l,c]=T(),g=(C,I,f)=>{const u=f!=null||n()!=null;return[f,n(),u&&I!=null?C:void 0].filter(Boolean).join(" ")||void 0},d=C=>[s(),l(),C].filter(Boolean).join(" ")||void 0,Q=R(()=>({"data-valid":rA(t.validationState)==="valid"?"":void 0,"data-invalid":rA(t.validationState)==="invalid"?"":void 0,"data-required":rA(t.required)?"":void 0,"data-disabled":rA(t.disabled)?"":void 0,"data-readonly":rA(t.readOnly)?"":void 0}));return{formControlContext:{name:()=>rA(t.name)??rA(t.id),dataset:Q,validationState:()=>rA(t.validationState),isRequired:()=>rA(t.required),isDisabled:()=>rA(t.disabled),isReadOnly:()=>rA(t.readOnly),labelId:n,fieldId:r,descriptionId:s,errorMessageId:l,getAriaLabelledBy:g,getAriaDescribedBy:d,generateId:ao(()=>rA(t.id)),registerLabel:ut(i),registerField:ut(o),registerDescription:ut(a),registerErrorMessage:ut(c)}}}var _4=A1();function Io(){const A=Pe(_4);if(A===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return A}function ed(A){const e=Io(),t=me({id:e.generateId("description")},A);return iA(()=>DA(e.registerDescription(t.id))),E(qe,fA({as:"div"},()=>e.dataset(),t))}function fH(A){let e;const t=Io(),n=me({id:t.generateId("label")},A),[i,r]=MA(n,["ref"]),o=HC(()=>e,()=>"label");return iA(()=>DA(t.registerLabel(r.id))),E(qe,fA({as:"label",ref(s){var a=it(l=>e=l,i.ref);typeof a=="function"&&a(s)},get for(){return IA(()=>o()==="label")()?t.fieldId():void 0}},()=>t.dataset(),r))}function F4(A,e){iA(B1(A,t=>{if(t==null)return;const n=pH(t);n!=null&&(n.addEventListener("reset",e,{passive:!0}),DA(()=>{n.removeEventListener("reset",e)}))}))}function pH(A){return mH(A)?A.form:A.closest("form")}function mH(A){return A.matches("textarea, input, select, button")}function td(A){const e=Io(),t=me({id:e.generateId("error-message")},A),[n,i]=MA(t,["forceMount"]),r=()=>e.validationState()==="invalid";return iA(()=>{r()&&DA(e.registerErrorMessage(i.id))}),E(H,{get when(){return n.forceMount||r()},get children(){return E(qe,fA({as:"div"},()=>e.dataset(),i))}})}var wH={};ha(wH,{Description:()=>ed,ErrorMessage:()=>td,Item:()=>U4,ItemControl:()=>nd,ItemDescription:()=>id,ItemIndicator:()=>rd,ItemInput:()=>T4,ItemLabel:()=>od,Label:()=>sd,RadioGroup:()=>il,Root:()=>O4,useRadioGroupContext:()=>nl});var G4=A1();function nl(){const A=Pe(G4);if(A===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return A}var R4=A1();function Ti(){const A=Pe(R4);if(A===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return A}function U4(A){const e=Io(),t=nl(),n=`${e.generateId("item")}-${Jt()}`,i=me({id:n},A),[r,o]=MA(i,["value","disabled","onPointerDown"]),[s,a]=T(),[l,c]=T(),[g,d]=T(),[Q,B]=T(),[C,I]=T(!1),f=R(()=>t.isDefaultValue(r.value)),u=R(()=>t.isSelectedValue(r.value)),p=R(()=>r.disabled||e.isDisabled()||!1),w=M=>{Z1(M,r.onPointerDown),C()&&M.preventDefault()},m=R(()=>({...e.dataset(),"data-disabled":p()?"":void 0,"data-checked":u()?"":void 0})),y={value:()=>r.value,dataset:m,isDefault:f,isSelected:u,isDisabled:p,inputId:s,labelId:l,descriptionId:g,inputRef:Q,select:()=>t.setSelectedValue(r.value),generateId:ao(()=>o.id),registerInput:ut(a),registerLabel:ut(c),registerDescription:ut(d),setIsFocused:I,setInputRef:B};return E(R4.Provider,{value:y,get children(){return E(qe,fA({as:"div",role:"group",onPointerDown:w},m,o))}})}function nd(A){const e=Ti(),t=me({id:e.generateId("control")},A),[n,i]=MA(t,["onClick","onKeyDown"]);return E(qe,fA({as:"div",onClick:s=>{Z1(s,n.onClick),e.select(),e.inputRef()?.focus()},onKeyDown:s=>{Z1(s,n.onKeyDown),s.key===KC.Space&&(e.select(),e.inputRef()?.focus())}},()=>e.dataset(),i))}function id(A){const e=Ti(),t=me({id:e.generateId("description")},A);return iA(()=>DA(e.registerDescription(t.id))),E(qe,fA({as:"div"},()=>e.dataset(),t))}function rd(A){const e=Ti(),t=me({id:e.generateId("indicator")},A),[n,i]=MA(t,["ref","forceMount"]),[r,o]=T(),{present:s}=p4({show:()=>n.forceMount||e.isSelected(),element:()=>r()??null});return E(H,{get when(){return s()},get children(){return E(qe,fA({as:"div",ref(a){var l=it(o,n.ref);typeof l=="function"&&l(a)}},()=>e.dataset(),i))}})}function T4(A){const e=Io(),t=nl(),n=Ti(),i=me({id:n.generateId("input")},A),[r,o]=MA(i,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),s=()=>[r["aria-labelledby"],n.labelId(),r["aria-labelledby"]!=null&&o["aria-label"]!=null?o.id:void 0].filter(Boolean).join(" ")||void 0,a=()=>[r["aria-describedby"],n.descriptionId(),t.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[l,c]=T(!1),g=B=>{if(Z1(B,r.onChange),B.stopPropagation(),!l()){t.setSelectedValue(n.value());const C=B.target;C.checked=n.isSelected()}c(!1)},d=B=>{Z1(B,r.onFocus),n.setIsFocused(!0)},Q=B=>{Z1(B,r.onBlur),n.setIsFocused(!1)};return iA(B1([()=>n.isSelected(),()=>n.value()],B=>{if(!B[0]&&B[1]===n.value())return;c(!0);const C=n.inputRef();C?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),C?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),iA(()=>DA(n.registerInput(o.id))),E(qe,fA({as:"input",ref(B){var C=it(n.setInputRef,r.ref);typeof C=="function"&&C(B)},type:"radio",get name(){return e.name()},get value(){return n.value()},get checked(){return n.isSelected()},get required(){return e.isRequired()},get disabled(){return n.isDisabled()},get readonly(){return e.isReadOnly()},get style(){return ua({...d2},r.style)},get"aria-labelledby"(){return s()},get"aria-describedby"(){return a()},onChange:g,onFocus:d,onBlur:Q},()=>n.dataset(),o))}function od(A){const e=Ti(),t=me({id:e.generateId("label")},A);return iA(()=>DA(e.registerLabel(t.id))),E(qe,fA({as:"label",get for(){return e.inputId()}},()=>e.dataset(),t))}function sd(A){return E(fH,fA({as:"span"},A))}function O4(A){let e;const t=`radiogroup-${Jt()}`,n=me({id:t,orientation:"vertical"},A),[i,r,o]=MA(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],hH),[s,a]=tl({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:I=>i.onChange?.(I)}),{formControlContext:l}=IH(r);F4(()=>e,()=>a(i.defaultValue??""));const c=()=>l.getAriaLabelledBy(rA(r.id),o["aria-label"],i["aria-labelledby"]),g=()=>l.getAriaDescribedBy(i["aria-describedby"]),d=I=>I===A.defaultValue,Q=I=>I===s(),C={ariaDescribedBy:g,isDefaultValue:d,isSelectedValue:Q,setSelectedValue:I=>{if(!(l.isReadOnly()||l.isDisabled())&&(a(I),e))for(const f of e.querySelectorAll("[type='radio']")){const u=f;u.checked=Q(u.value)}}};return E(_4.Provider,{value:l,get children(){return E(G4.Provider,{value:C,get children(){return E(qe,fA({as:"div",ref(I){var f=it(u=>e=u,i.ref);typeof f=="function"&&f(I)},role:"radiogroup",get id(){return rA(r.id)},get"aria-invalid"(){return l.validationState()==="invalid"||void 0},get"aria-required"(){return l.isRequired()||void 0},get"aria-disabled"(){return l.isDisabled()||void 0},get"aria-readonly"(){return l.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return c()},get"aria-describedby"(){return g()}},()=>l.dataset(),o))}})}})}var il=Object.assign(O4,{Description:ed,ErrorMessage:td,Item:U4,ItemControl:nd,ItemDescription:id,ItemIndicator:rd,ItemInput:T4,ItemLabel:od,Label:sd});function yH(A,e){const t=new ResizeObserver(A);return DA(t.disconnect.bind(t)),{observe:n=>t.observe(n,e),unobserve:t.unobserve.bind(t)}}function DH(A,e,t){const n=new WeakMap,{observe:i,unobserve:r}=yH(o=>{for(const s of o){const{contentRect:a,target:l}=s,c=Math.round(a.width),g=Math.round(a.height),d=n.get(l);(!d||d.width!==c||d.height!==g)&&(e(a,l,s),n.set(l,{width:c,height:g}))}},t);iA(o=>{const s=UC(Ns(rA(A)));return TC(s,o,i,r),s},[])}var K4=A1();function q4(){const A=Pe(K4);if(A===void 0)throw new Error("[kobalte]: `useSegmentedControlContext` must be used within a `SegmentedControl` component");return A}function kH(A){const e=q4(),[t,n]=MA(A,["style"]),[i,r]=T(),[o,s]=T(!1),a=()=>{const c=e.selectedItem();if(!c){r(void 0);return}r({width:`${c.offsetWidth}px`,height:`${c.offsetHeight}px`,transform:l(c),"transition-duration":o()?"0ms":void 0})},l=c=>{const g=getComputedStyle(c.parentElement),d=c.offsetLeft-Number.parseFloat(g.paddingLeft),Q=c.offsetTop-Number.parseFloat(g.paddingTop);return`translate(${d}px, ${Q}px)`};return iA(B1(e.selectedItem,()=>{s(!i()),a(),s(!1)})),DH(e.root,()=>{qc(()=>{s(!0),a(),s(!1)})}),E(qe,fA({as:"div",role:"presentation",get style(){return ua(i(),t.style)},get"data-resizing"(){return o()},get"data-orientation"(){return e.orientation()}},n))}var bH=A=>{const e=nl(),t=q4(),[n,i]=MA(A,["ref"]),[r,o]=T();return iA(()=>{const s=r();s&&e.isSelectedValue(A.value)&&t.setSelectedItem(s)}),E(il.Item,fA({ref(s){var a=it(o,n.ref);typeof a=="function"&&a(s)}},i))},vH=A=>{const e=Ti(),[t,n]=MA(A,["ref"]),[i,r]=T();return F4(i,()=>{requestAnimationFrame(()=>{e.isDefault()&&e.select()})}),E(il.ItemInput,fA({ref(o){var s=it(r,t.ref);typeof s=="function"&&s(o)}},n))},MH=A=>{const e=fA({defaultValue:A.value,orientation:"horizontal"},A),[t,n]=MA(e,["ref"]),[i,r]=T(),[o,s]=T(),a={value:()=>n.value,defaultValue:()=>n.defaultValue,orientation:()=>n.orientation,root:i,selectedItem:o,setSelectedItem:s};return iA(()=>{a.value()||s(void 0)}),E(K4.Provider,{value:a,get children(){return E(il,fA({ref(l){var c=it(r,t.ref);typeof c=="function"&&c(l)}},n))}})},Ar=Object.assign(MH,{Description:ed,ErrorMessage:td,Indicator:kH,Item:bH,ItemControl:nd,ItemDescription:id,ItemIndicator:rd,ItemInput:vH,ItemLabel:od,Label:sd}),NH=k("<div role=presentation data-slot=radio-group-wrapper><div role=presentation data-slot=radio-group-items>"),SH=k("<span data-slot=radio-group-item-control>");function xH(A){const[e,t]=MA(A,["class","classList","options","current","defaultValue","value","label","onSelect","size","fill","pad"]),n=o=>e.value?e.value(o):String(o),i=o=>e.label?e.label(o):String(o),r=o=>e.options.find(s=>n(s)===o);return E(Ar,fA(t,{"data-component":"radio-group",get"data-size"(){return e.size??"medium"},get"data-fill"(){return e.fill?"":void 0},get"data-pad"(){return e.pad??"normal"},get classList(){return{...e.classList,[e.class??""]:!!e.class}},get value(){return IA(()=>!!e.current)()?n(e.current):void 0},get defaultValue(){return IA(()=>!!e.defaultValue)()?n(e.defaultValue):void 0},onChange:o=>e.onSelect?.(r(o)),get children(){var o=NH(),s=o.firstChild;return h(o,E(Ar.Indicator,{"data-slot":"radio-group-indicator"}),s),h(s,E(hA,{get each(){return e.options},children:a=>E(Ar.Item,{get value(){return n(a)},"data-slot":"radio-group-item",get"data-value"(){return n(a)},get children(){return[E(Ar.ItemInput,{"data-slot":"radio-group-item-input"}),E(Ar.ItemLabel,{"data-slot":"radio-group-item-label",get children(){var l=SH();return h(l,()=>i(a)),l}})]}})})),o}}))}function LH(A){return E(cr.Header,{"data-component":"sticky-accordion-header",get classList(){return{...A.classList,[A.class??""]:!!A.class}},get children(){return A.children}})}const TE=new Map;function _H(A){const[e]=aK(A),t=[],n=[];if(!e)return{before:"",after:""};for(const i of e.hunks)for(const r of i.lines)r.startsWith("-")?t.push(r.slice(1)):(r.startsWith("+")||t.push(r.slice(1)),n.push(r.slice(1)));return{before:t.join(`
|