makecoder 2.0.72 → 2.0.77

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.
Files changed (25) hide show
  1. package/dist/cc.mjs +2252 -2280
  2. package/dist/coder.js +42 -84
  3. package/dist/gemini/{chunk-742OPB22.js → chunk-5NLMIA5F.js} +2 -2
  4. package/dist/gemini/{chunk-LJWQXOG6.js → chunk-ERSD2JN4.js} +2 -2
  5. package/dist/gemini/{chunk-YTXPXB3F.js → chunk-RINXQT6K.js} +2 -2
  6. package/dist/gemini/{chunk-CN5ZY54S.js → chunk-YYIHO5TB.js} +2 -2
  7. package/dist/gemini/{core-CQOMB6GX.js → core-QJQCNUBM.js} +1 -1
  8. package/dist/gemini/{devtoolsService-LPWJ7GXG.js → devtoolsService-6N7SRZYV.js} +2 -2
  9. package/dist/gemini/{devtoolsService-JSKAKMKA.js → devtoolsService-F37ICBM5.js} +2 -2
  10. package/dist/gemini/{dist-MMPCC5OA.js → dist-RUT7TWHF.js} +1 -1
  11. package/dist/gemini/gemini.js +4 -4
  12. package/dist/gemini/{interactiveCli-457SCMEA.js → interactiveCli-F5Z22JJJ.js} +2 -2
  13. package/dist/gemini/{interactiveCli-XB5DZLWK.js → interactiveCli-T7HAFJKN.js} +2 -2
  14. package/dist/gemini/{oauth2-provider-ZNP4J6EF.js → oauth2-provider-224QQNUV.js} +1 -1
  15. package/dist/gemini/{oauth2-provider-LSK6ONS7.js → oauth2-provider-BAYGJHVR.js} +1 -1
  16. package/dist/vendor/seccomp/arm64/apply-seccomp +0 -0
  17. package/dist/vendor/seccomp/x64/apply-seccomp +0 -0
  18. package/package.json +9 -4
  19. package/claude/claw/channels/feishu.md +0 -137
  20. package/claude/claw/channels/qq.md +0 -60
  21. package/claude/claw/channels/wecom.md +0 -64
  22. package/claude/claw/channels/weixin.md +0 -164
  23. package/claude/commands/claw.md +0 -127
  24. /package/dist/gemini/{tree-sitter-JU2EI3Z2.js → tree-sitter-JHZH2GQM.js} +0 -0
  25. /package/dist/gemini/{tree-sitter-bash-IAB7XJEE.js → tree-sitter-bash-KH6DKFBJ.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
- import{$ as ST,$a as Ha,$b as Pf,A as ki,Ab as Ui,Ac as bx,B as ai,Bb as qT,Bc as nd,C as mT,Ca as _T,Cb as Fi,Cc as rd,D as Gs,Db as hn,Dc as id,E as Qt,Eb as d,Ec as sd,F as Xu,Fb as KT,Fc as Sx,G as Pt,Gb as VT,Gc as Tx,H as Xn,Hb as Lf,Hc as ad,I as Jt,Ib as zT,Ic as ld,J as Af,Jb as YT,Jc as Vs,K as Un,Kb as XT,Kc as cd,L as pT,La as vT,Lb as Mo,Lc as Bf,M as ne,Mb as jT,Mc as xx,N as Ws,Nb as lt,Nc as Ex,Ob as ed,Oc as za,Pb as M,Pc as ud,Q as fT,Qb as QT,Qc as Cx,R as gT,Rb as pe,Rc as yn,S as If,Sa as wT,Sb as Ct,Sc as fc,Ta as RT,Tb as mc,Tc as _x,U as hT,Ua as Of,Ub as JT,Uc as vx,Va as AT,Vb as ZT,Vc as Do,Wa as IT,Wb as ex,Wc as wx,X as yT,Xa as OT,Xb as Xe,Xc as dd,Y as bT,Ya as NT,Yb as td,Yc as Rx,Za as gn,Zb as Ve,Zc as Ax,_ as li,_a as Nf,_b as tx,_c as Ix,ab as MT,ac as ox,ad as md,b as Fs,bb as DT,bc as nx,bd as Ox,c as JS,cb as Ju,cc as rx,cd as Nx,d as Mr,da as Bi,db as LT,dc as ix,e as cc,eb as kr,ec as sx,ed as Qo,f as si,fb as Ga,fc as ax,fd as pd,g as ZS,gb as PT,gc as lx,gd as kt,h as Rf,ha as Pr,hb as dc,hc as cx,i as eT,ib as Wa,ic as Ka,j as tT,ja as TT,jb as $a,jc as $s,k as oT,kb as Zu,kc as ux,l as nT,la as ju,lb as kT,lc as kf,m as Dr,mb as Mf,mc as dx,n as rT,nb as BT,nc as qs,o as iT,ob as Df,oc as Ks,p as sT,pb as UT,pc,q as aT,qa as xT,qb as FT,qc as mx,r as lT,rb as qa,rc as px,s as cT,sb as HT,sc as Va,t as Hs,ta as Qu,tb as p,tc as _t,u as uc,ua as ET,ub as u,uc as fx,va as CT,vb as jn,vc as gx,w as uT,wa as Fa,wb as GT,wc as od,x as dT,xa as ot,xb as WT,xc as _e,y as Lr,yb as $T,yc as hx,zb as No,zc as yx}from"./chunk-LJWQXOG6.js";import{$ as Lu,Ab as yf,Cg as IS,Eg as OS,Fb as jb,Fg as NS,Fi as xf,Fk as HS,Gg as MS,H as Fb,Hc as oS,Hi as Ef,Ia as $b,Ig as Ye,J as Ou,Ja as qb,Jc as bf,Jf as vS,Jh as Gt,K as Nu,Ka as Kb,Kc as nS,Kl as qS,Lc as rS,Lj as Ba,Mb as Qb,Nc as iS,Oc as sS,Oe as lc,P as ff,Pc as aS,Pd as Fu,Pe as TS,Pm as QS,Qe as Hu,Rc as lS,Rd as fS,Sm as wf,Td as gS,Te as Gu,Ue as xS,Uf as wS,Ug as DS,Ui as Cf,Vi as US,Vl as KS,Wj as _f,Xb as Bn,Zi as $u,_ as Du,_b as Jb,aa as fe,ac as Ps,ae as hS,bc as ks,bm as VS,cf as Tf,ci as LS,eb as Vb,eg as RS,ei as PS,em as zu,fb as zb,fi as kS,gk as Ku,he as Sf,hi as Nr,hl as pr,ib as Yb,ic as Pu,id as Li,il as Ua,im as Yu,jc as Da,ji as BS,jm as Us,kc as ku,kd as cS,ke as yS,kk as FS,lc as Zb,lg as AS,ll as GS,mc as Bu,md as uS,ml as WS,mm as zS,nc as eS,ne as bS,nm as vf,ob as Ma,od as dS,ol as $S,pm as YS,qd as mS,rb as Xb,rf as Pi,rk as Vu,rm as XS,sf as La,sg as Wu,tc as Uu,tf as Pa,tm as jS,ua as gf,ud as pS,vf as ES,vh as Yn,wc as tS,we as Bs,wf as CS,x as Ub,ye as SS,yf as _S,yi as ro,zb as hf,zi as ka}from"./chunk-742OPB22.js";import{$ as Ob,A as Ls,Aa as Di,B as Rb,Ba as sc,Ca as Lb,Da as wu,E as Je,Ea as ac,K as Ab,Md as Hb,Na as Et,Od as Gb,Pa as Ru,Qd as Wb,Sc as pf,Sd as ze,Ua as Au,Ud as Ce,V as Ze,Vb as Iu,W as Or,Wa as Pb,Z as Ib,b as Ee,ba as Nb,c as vb,ca as Mb,ea as Db,j as wb,je as qu,na as Oa,t as Ho,td as Bb,ua as df,ub as kb,va as vu,wa as mf,xa as rc,xd as Mu,ya as Na,za as ic,zd as mr}from"./chunk-SX66NO2U.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as Rt,c as at,d as kN,e as E}from"./chunk-YUXORC52.js";var cC=at((OU,lC)=>{function jE(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let o=e[t],n=typeof o;(n==="object"||n==="function")&&!Object.isFrozen(o)&&jE(o)}),e}var Ad=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function QE(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Wi(e,...t){let o=Object.create(null);for(let n in e)o[n]=e[n];return t.forEach(function(n){for(let r in n)o[r]=n[r]}),o}var EM="</span>",qE=e=>!!e.scope,CM=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let o=e.split(".");return[`${t}${o.shift()}`,...o.map((n,r)=>`${n}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},qf=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=QE(t)}openNode(t){if(!qE(t))return;let o=CM(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){qE(t)&&(this.buffer+=EM)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},KE=(e={})=>{let t={children:[]};return Object.assign(t,e),t},Kf=class e{constructor(){this.rootNode=KE(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let o=KE({scope:t});this.add(o),this.stack.push(o)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,o){return typeof o=="string"?t.addText(o):o.children&&(t.openNode(o),o.children.forEach(n=>this._walk(t,n)),t.closeNode(o)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(o=>typeof o=="string")?t.children=[t.children.join("")]:t.children.forEach(o=>{e._collapse(o)}))}},Vf=class extends Kf{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,o){let n=t.root;o&&(n.scope=`language:${o}`),this.add(n)}toHTML(){return new qf(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function hc(e){return e?typeof e=="string"?e:e.source:null}function JE(e){return Ys("(?=",e,")")}function _M(e){return Ys("(?:",e,")*")}function vM(e){return Ys("(?:",e,")?")}function Ys(...e){return e.map(o=>hc(o)).join("")}function wM(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Yf(...e){return"("+(wM(e).capture?"":"?:")+e.map(n=>hc(n)).join("|")+")"}function ZE(e){return new RegExp(e.toString()+"|").exec("").length-1}function RM(e,t){let o=e&&e.exec(t);return o&&o.index===0}var AM=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Xf(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,s=hc(n),i="";for(;s.length>0;){let a=AM.exec(s);if(!a){i+=s;break}i+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?i+="\\"+String(Number(a[1])+r):(i+=a[0],a[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var IM=/\b\B/,eC="[a-zA-Z]\\w*",jf="[a-zA-Z_]\\w*",tC="\\b\\d+(\\.\\d+)?",oC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",nC="\\b(0b[01]+)",OM="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",NM=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=Ys(t,/.*\b/,e.binary,/\b.*/)),Wi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},yc={begin:"\\\\[\\s\\S]",relevance:0},MM={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[yc]},DM={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[yc]},LM={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Od=function(e,t,o={}){let n=Wi({scope:"comment",begin:e,end:t,contains:[]},o);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Yf("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:Ys(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},PM=Od("//","$"),kM=Od("/\\*","\\*/"),BM=Od("#","$"),UM={scope:"number",begin:tC,relevance:0},FM={scope:"number",begin:oC,relevance:0},HM={scope:"number",begin:nC,relevance:0},GM={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[yc,{begin:/\[/,end:/\]/,relevance:0,contains:[yc]}]},WM={scope:"title",begin:eC,relevance:0},$M={scope:"title",begin:jf,relevance:0},qM={begin:"\\.\\s*"+jf,relevance:0},KM=function(e){return Object.assign(e,{"on:begin":(t,o)=>{o.data._beginMatch=t[1]},"on:end":(t,o)=>{o.data._beginMatch!==t[1]&&o.ignoreMatch()}})},Rd=Object.freeze({__proto__:null,APOS_STRING_MODE:MM,BACKSLASH_ESCAPE:yc,BINARY_NUMBER_MODE:HM,BINARY_NUMBER_RE:nC,COMMENT:Od,C_BLOCK_COMMENT_MODE:kM,C_LINE_COMMENT_MODE:PM,C_NUMBER_MODE:FM,C_NUMBER_RE:oC,END_SAME_AS_BEGIN:KM,HASH_COMMENT_MODE:BM,IDENT_RE:eC,MATCH_NOTHING_RE:IM,METHOD_GUARD:qM,NUMBER_MODE:UM,NUMBER_RE:tC,PHRASAL_WORDS_MODE:LM,QUOTE_STRING_MODE:DM,REGEXP_MODE:GM,RE_STARTERS_RE:OM,SHEBANG:NM,TITLE_MODE:WM,UNDERSCORE_IDENT_RE:jf,UNDERSCORE_TITLE_MODE:$M});function VM(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function zM(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function YM(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=VM,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function XM(e,t){Array.isArray(e.illegal)&&(e.illegal=Yf(...e.illegal))}function jM(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function QM(e,t){e.relevance===void 0&&(e.relevance=1)}var JM=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let o=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=o.keywords,e.begin=Ys(o.beforeMatch,JE(o.begin)),e.starts={relevance:0,contains:[Object.assign(o,{endsParent:!0})]},e.relevance=0,delete o.beforeMatch},ZM=["of","and","for","in","not","or","if","then","parent","list","value"],eD="keyword";function rC(e,t,o=eD){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(s){Object.assign(n,rC(e[s],t,s))}),n;function r(s,i){t&&(i=i.map(a=>a.toLowerCase())),i.forEach(function(a){let l=a.split("|");n[l[0]]=[s,tD(l[0],l[1])]})}}function tD(e,t){return t?Number(t):oD(e)?0:1}function oD(e){return ZM.includes(e.toLowerCase())}var VE={},zs=e=>{console.error(e)},zE=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Za=(e,t)=>{VE[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),VE[`${e}/${t}`]=!0)},Id=new Error;function iC(e,t,{key:o}){let n=0,r=e[o],s={},i={};for(let a=1;a<=t.length;a++)i[a+n]=r[a],s[a+n]=!0,n+=ZE(t[a-1]);e[o]=i,e[o]._emit=s,e[o]._multi=!0}function nD(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw zs("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Id;if(typeof e.beginScope!="object"||e.beginScope===null)throw zs("beginScope must be object"),Id;iC(e,e.begin,{key:"beginScope"}),e.begin=Xf(e.begin,{joinWith:""})}}function rD(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw zs("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Id;if(typeof e.endScope!="object"||e.endScope===null)throw zs("endScope must be object"),Id;iC(e,e.end,{key:"endScope"}),e.end=Xf(e.end,{joinWith:""})}}function iD(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function sD(e){iD(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),nD(e),rD(e)}function aD(e){function t(i,a){return new RegExp(hc(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=ZE(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=t(Xf(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((f,g)=>g>0&&f!==void 0),m=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,m)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new o;return this.rules.slice(a).forEach(([c,m])=>l.addRule(c,m)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let m=this.getMatcher(0);m.lastIndex=this.lastIndex+1,c=m.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function r(i){let a=new n;return i.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),a}function s(i,a){let l=i;if(i.isCompiled)return l;[zM,jM,sD,JM].forEach(m=>m(i,a)),e.compilerExtensions.forEach(m=>m(i,a)),i.__beforeBegin=null,[YM,XM,QM].forEach(m=>m(i,a)),i.isCompiled=!0;let c=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),c=i.keywords.$pattern,delete i.keywords.$pattern),c=c||/\w+/,i.keywords&&(i.keywords=rC(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),a&&(i.begin||(i.begin=/\B|\b/),l.beginRe=t(l.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(l.endRe=t(l.end)),l.terminatorEnd=hc(l.end)||"",i.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(m){return lD(m==="self"?i:m)})),i.contains.forEach(function(m){s(m,l)}),i.starts&&s(i.starts,a),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Wi(e.classNameAliases||{}),s(e)}function sC(e){return e?e.endsWithParent||sC(e.starts):!1}function lD(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Wi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:sC(e)?Wi(e,{starts:e.starts?Wi(e.starts):null}):Object.isFrozen(e)?Wi(e):e}var cD="11.11.1",zf=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},$f=QE,YE=Wi,XE=Symbol("nomatch"),uD=7,aC=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,s="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Vf};function l(O){return a.noHighlightRe.test(O)}function c(O){let U=O.className+" ";U+=O.parentNode?O.parentNode.className:"";let L=a.languageDetectRe.exec(U);if(L){let H=_(L[1]);return H||(zE(s.replace("{}",L[1])),zE("Falling back to no-highlight mode for this block.",O)),H?L[1]:"no-highlight"}return U.split(/\s+/).find(H=>l(H)||_(H))}function m(O,U,L){let H="",$="";typeof U=="object"?(H=O,L=U.ignoreIllegals,$=U.language):(Za("10.7.0","highlight(lang, code, ...args) has been deprecated."),Za("10.7.0",`Please use highlight(code, options) instead.
2
+ import{$ as ST,$a as Ha,$b as Pf,A as ki,Ab as Ui,Ac as bx,B as ai,Bb as qT,Bc as nd,C as mT,Ca as _T,Cb as Fi,Cc as rd,D as Gs,Db as hn,Dc as id,E as Qt,Eb as d,Ec as sd,F as Xu,Fb as KT,Fc as Sx,G as Pt,Gb as VT,Gc as Tx,H as Xn,Hb as Lf,Hc as ad,I as Jt,Ib as zT,Ic as ld,J as Af,Jb as YT,Jc as Vs,K as Un,Kb as XT,Kc as cd,L as pT,La as vT,Lb as Mo,Lc as Bf,M as ne,Mb as jT,Mc as xx,N as Ws,Nb as lt,Nc as Ex,Ob as ed,Oc as za,Pb as M,Pc as ud,Q as fT,Qb as QT,Qc as Cx,R as gT,Rb as pe,Rc as yn,S as If,Sa as wT,Sb as Ct,Sc as fc,Ta as RT,Tb as mc,Tc as _x,U as hT,Ua as Of,Ub as JT,Uc as vx,Va as AT,Vb as ZT,Vc as Do,Wa as IT,Wb as ex,Wc as wx,X as yT,Xa as OT,Xb as Xe,Xc as dd,Y as bT,Ya as NT,Yb as td,Yc as Rx,Za as gn,Zb as Ve,Zc as Ax,_ as li,_a as Nf,_b as tx,_c as Ix,ab as MT,ac as ox,ad as md,b as Fs,bb as DT,bc as nx,bd as Ox,c as JS,cb as Ju,cc as rx,cd as Nx,d as Mr,da as Bi,db as LT,dc as ix,e as cc,eb as kr,ec as sx,ed as Qo,f as si,fb as Ga,fc as ax,fd as pd,g as ZS,gb as PT,gc as lx,gd as kt,h as Rf,ha as Pr,hb as dc,hc as cx,i as eT,ib as Wa,ic as Ka,j as tT,ja as TT,jb as $a,jc as $s,k as oT,kb as Zu,kc as ux,l as nT,la as ju,lb as kT,lc as kf,m as Dr,mb as Mf,mc as dx,n as rT,nb as BT,nc as qs,o as iT,ob as Df,oc as Ks,p as sT,pb as UT,pc,q as aT,qa as xT,qb as FT,qc as mx,r as lT,rb as qa,rc as px,s as cT,sb as HT,sc as Va,t as Hs,ta as Qu,tb as p,tc as _t,u as uc,ua as ET,ub as u,uc as fx,va as CT,vb as jn,vc as gx,w as uT,wa as Fa,wb as GT,wc as od,x as dT,xa as ot,xb as WT,xc as _e,y as Lr,yb as $T,yc as hx,zb as No,zc as yx}from"./chunk-ERSD2JN4.js";import{$ as Lu,Ab as yf,Cg as IS,Eg as OS,Fb as jb,Fg as NS,Fi as xf,Fk as HS,Gg as MS,H as Fb,Hc as oS,Hi as Ef,Ia as $b,Ig as Ye,J as Ou,Ja as qb,Jc as bf,Jf as vS,Jh as Gt,K as Nu,Ka as Kb,Kc as nS,Kl as qS,Lc as rS,Lj as Ba,Mb as Qb,Nc as iS,Oc as sS,Oe as lc,P as ff,Pc as aS,Pd as Fu,Pe as TS,Pm as QS,Qe as Hu,Rc as lS,Rd as fS,Sm as wf,Td as gS,Te as Gu,Ue as xS,Uf as wS,Ug as DS,Ui as Cf,Vi as US,Vl as KS,Wj as _f,Xb as Bn,Zi as $u,_ as Du,_b as Jb,aa as fe,ac as Ps,ae as hS,bc as ks,bm as VS,cf as Tf,ci as LS,eb as Vb,eg as RS,ei as PS,em as zu,fb as zb,fi as kS,gk as Ku,he as Sf,hi as Nr,hl as pr,ib as Yb,ic as Pu,id as Li,il as Ua,im as Yu,jc as Da,ji as BS,jm as Us,kc as ku,kd as cS,ke as yS,kk as FS,lc as Zb,lg as AS,ll as GS,mc as Bu,md as uS,ml as WS,mm as zS,nc as eS,ne as bS,nm as vf,ob as Ma,od as dS,ol as $S,pm as YS,qd as mS,rb as Xb,rf as Pi,rk as Vu,rm as XS,sf as La,sg as Wu,tc as Uu,tf as Pa,tm as jS,ua as gf,ud as pS,vf as ES,vh as Yn,wc as tS,we as Bs,wf as CS,x as Ub,ye as SS,yf as _S,yi as ro,zb as hf,zi as ka}from"./chunk-5NLMIA5F.js";import{$ as Ob,A as Ls,Aa as Di,B as Rb,Ba as sc,Ca as Lb,Da as wu,E as Je,Ea as ac,K as Ab,Md as Hb,Na as Et,Od as Gb,Pa as Ru,Qd as Wb,Sc as pf,Sd as ze,Ua as Au,Ud as Ce,V as Ze,Vb as Iu,W as Or,Wa as Pb,Z as Ib,b as Ee,ba as Nb,c as vb,ca as Mb,ea as Db,j as wb,je as qu,na as Oa,t as Ho,td as Bb,ua as df,ub as kb,va as vu,wa as mf,xa as rc,xd as Mu,ya as Na,za as ic,zd as mr}from"./chunk-SX66NO2U.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as Rt,c as at,d as kN,e as E}from"./chunk-YUXORC52.js";var cC=at((OU,lC)=>{function jE(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let o=e[t],n=typeof o;(n==="object"||n==="function")&&!Object.isFrozen(o)&&jE(o)}),e}var Ad=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function QE(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Wi(e,...t){let o=Object.create(null);for(let n in e)o[n]=e[n];return t.forEach(function(n){for(let r in n)o[r]=n[r]}),o}var EM="</span>",qE=e=>!!e.scope,CM=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let o=e.split(".");return[`${t}${o.shift()}`,...o.map((n,r)=>`${n}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},qf=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=QE(t)}openNode(t){if(!qE(t))return;let o=CM(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){qE(t)&&(this.buffer+=EM)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},KE=(e={})=>{let t={children:[]};return Object.assign(t,e),t},Kf=class e{constructor(){this.rootNode=KE(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let o=KE({scope:t});this.add(o),this.stack.push(o)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,o){return typeof o=="string"?t.addText(o):o.children&&(t.openNode(o),o.children.forEach(n=>this._walk(t,n)),t.closeNode(o)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(o=>typeof o=="string")?t.children=[t.children.join("")]:t.children.forEach(o=>{e._collapse(o)}))}},Vf=class extends Kf{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,o){let n=t.root;o&&(n.scope=`language:${o}`),this.add(n)}toHTML(){return new qf(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function hc(e){return e?typeof e=="string"?e:e.source:null}function JE(e){return Ys("(?=",e,")")}function _M(e){return Ys("(?:",e,")*")}function vM(e){return Ys("(?:",e,")?")}function Ys(...e){return e.map(o=>hc(o)).join("")}function wM(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Yf(...e){return"("+(wM(e).capture?"":"?:")+e.map(n=>hc(n)).join("|")+")"}function ZE(e){return new RegExp(e.toString()+"|").exec("").length-1}function RM(e,t){let o=e&&e.exec(t);return o&&o.index===0}var AM=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Xf(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,s=hc(n),i="";for(;s.length>0;){let a=AM.exec(s);if(!a){i+=s;break}i+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?i+="\\"+String(Number(a[1])+r):(i+=a[0],a[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var IM=/\b\B/,eC="[a-zA-Z]\\w*",jf="[a-zA-Z_]\\w*",tC="\\b\\d+(\\.\\d+)?",oC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",nC="\\b(0b[01]+)",OM="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",NM=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=Ys(t,/.*\b/,e.binary,/\b.*/)),Wi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},yc={begin:"\\\\[\\s\\S]",relevance:0},MM={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[yc]},DM={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[yc]},LM={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Od=function(e,t,o={}){let n=Wi({scope:"comment",begin:e,end:t,contains:[]},o);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Yf("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:Ys(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},PM=Od("//","$"),kM=Od("/\\*","\\*/"),BM=Od("#","$"),UM={scope:"number",begin:tC,relevance:0},FM={scope:"number",begin:oC,relevance:0},HM={scope:"number",begin:nC,relevance:0},GM={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[yc,{begin:/\[/,end:/\]/,relevance:0,contains:[yc]}]},WM={scope:"title",begin:eC,relevance:0},$M={scope:"title",begin:jf,relevance:0},qM={begin:"\\.\\s*"+jf,relevance:0},KM=function(e){return Object.assign(e,{"on:begin":(t,o)=>{o.data._beginMatch=t[1]},"on:end":(t,o)=>{o.data._beginMatch!==t[1]&&o.ignoreMatch()}})},Rd=Object.freeze({__proto__:null,APOS_STRING_MODE:MM,BACKSLASH_ESCAPE:yc,BINARY_NUMBER_MODE:HM,BINARY_NUMBER_RE:nC,COMMENT:Od,C_BLOCK_COMMENT_MODE:kM,C_LINE_COMMENT_MODE:PM,C_NUMBER_MODE:FM,C_NUMBER_RE:oC,END_SAME_AS_BEGIN:KM,HASH_COMMENT_MODE:BM,IDENT_RE:eC,MATCH_NOTHING_RE:IM,METHOD_GUARD:qM,NUMBER_MODE:UM,NUMBER_RE:tC,PHRASAL_WORDS_MODE:LM,QUOTE_STRING_MODE:DM,REGEXP_MODE:GM,RE_STARTERS_RE:OM,SHEBANG:NM,TITLE_MODE:WM,UNDERSCORE_IDENT_RE:jf,UNDERSCORE_TITLE_MODE:$M});function VM(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function zM(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function YM(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=VM,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function XM(e,t){Array.isArray(e.illegal)&&(e.illegal=Yf(...e.illegal))}function jM(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function QM(e,t){e.relevance===void 0&&(e.relevance=1)}var JM=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let o=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=o.keywords,e.begin=Ys(o.beforeMatch,JE(o.begin)),e.starts={relevance:0,contains:[Object.assign(o,{endsParent:!0})]},e.relevance=0,delete o.beforeMatch},ZM=["of","and","for","in","not","or","if","then","parent","list","value"],eD="keyword";function rC(e,t,o=eD){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(s){Object.assign(n,rC(e[s],t,s))}),n;function r(s,i){t&&(i=i.map(a=>a.toLowerCase())),i.forEach(function(a){let l=a.split("|");n[l[0]]=[s,tD(l[0],l[1])]})}}function tD(e,t){return t?Number(t):oD(e)?0:1}function oD(e){return ZM.includes(e.toLowerCase())}var VE={},zs=e=>{console.error(e)},zE=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Za=(e,t)=>{VE[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),VE[`${e}/${t}`]=!0)},Id=new Error;function iC(e,t,{key:o}){let n=0,r=e[o],s={},i={};for(let a=1;a<=t.length;a++)i[a+n]=r[a],s[a+n]=!0,n+=ZE(t[a-1]);e[o]=i,e[o]._emit=s,e[o]._multi=!0}function nD(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw zs("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Id;if(typeof e.beginScope!="object"||e.beginScope===null)throw zs("beginScope must be object"),Id;iC(e,e.begin,{key:"beginScope"}),e.begin=Xf(e.begin,{joinWith:""})}}function rD(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw zs("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Id;if(typeof e.endScope!="object"||e.endScope===null)throw zs("endScope must be object"),Id;iC(e,e.end,{key:"endScope"}),e.end=Xf(e.end,{joinWith:""})}}function iD(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function sD(e){iD(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),nD(e),rD(e)}function aD(e){function t(i,a){return new RegExp(hc(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=ZE(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=t(Xf(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((f,g)=>g>0&&f!==void 0),m=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,m)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new o;return this.rules.slice(a).forEach(([c,m])=>l.addRule(c,m)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let m=this.getMatcher(0);m.lastIndex=this.lastIndex+1,c=m.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function r(i){let a=new n;return i.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),a}function s(i,a){let l=i;if(i.isCompiled)return l;[zM,jM,sD,JM].forEach(m=>m(i,a)),e.compilerExtensions.forEach(m=>m(i,a)),i.__beforeBegin=null,[YM,XM,QM].forEach(m=>m(i,a)),i.isCompiled=!0;let c=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),c=i.keywords.$pattern,delete i.keywords.$pattern),c=c||/\w+/,i.keywords&&(i.keywords=rC(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),a&&(i.begin||(i.begin=/\B|\b/),l.beginRe=t(l.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(l.endRe=t(l.end)),l.terminatorEnd=hc(l.end)||"",i.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(m){return lD(m==="self"?i:m)})),i.contains.forEach(function(m){s(m,l)}),i.starts&&s(i.starts,a),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Wi(e.classNameAliases||{}),s(e)}function sC(e){return e?e.endsWithParent||sC(e.starts):!1}function lD(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Wi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:sC(e)?Wi(e,{starts:e.starts?Wi(e.starts):null}):Object.isFrozen(e)?Wi(e):e}var cD="11.11.1",zf=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},$f=QE,YE=Wi,XE=Symbol("nomatch"),uD=7,aC=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,s="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Vf};function l(O){return a.noHighlightRe.test(O)}function c(O){let U=O.className+" ";U+=O.parentNode?O.parentNode.className:"";let L=a.languageDetectRe.exec(U);if(L){let H=_(L[1]);return H||(zE(s.replace("{}",L[1])),zE("Falling back to no-highlight mode for this block.",O)),H?L[1]:"no-highlight"}return U.split(/\s+/).find(H=>l(H)||_(H))}function m(O,U,L){let H="",$="";typeof U=="object"?(H=O,L=U.ignoreIllegals,$=U.language):(Za("10.7.0","highlight(lang, code, ...args) has been deprecated."),Za("10.7.0",`Please use highlight(code, options) instead.
3
3
  https://github.com/highlightjs/highlight.js/issues/2277`),$=O,H=U),L===void 0&&(L=!0);let K={code:H,language:$};D("before:highlight",K);let F=K.result?K.result:f(K.language,K.code,L);return F.code=K.code,D("after:highlight",F),F}function f(O,U,L,H){let $=Object.create(null);function K(le,oe){return le.keywords[oe]}function F(){if(!Te.keywords){it.addText(Fe);return}let le=0;Te.keywordPatternRe.lastIndex=0;let oe=Te.keywordPatternRe.exec(Fe),ye="";for(;oe;){ye+=Fe.substring(le,oe.index);let Qe=Ue.case_insensitive?oe[0].toLowerCase():oe[0],bt=K(Te,Qe);if(bt){let[St,In]=bt;if(it.addText(ye),ye="",$[Qe]=($[Qe]||0)+1,$[Qe]<=uD&&(Ht+=In),St.startsWith("_"))ye+=oe[0];else{let ar=Ue.classNameAliases[St]||St;J(oe[0],ar)}}else ye+=oe[0];le=Te.keywordPatternRe.lastIndex,oe=Te.keywordPatternRe.exec(Fe)}ye+=Fe.substring(le),it.addText(ye)}function q(){if(Fe==="")return;let le=null;if(typeof Te.subLanguage=="string"){if(!t[Te.subLanguage]){it.addText(Fe);return}le=f(Te.subLanguage,Fe,!0,Pe[Te.subLanguage]),Pe[Te.subLanguage]=le._top}else le=b(Fe,Te.subLanguage.length?Te.subLanguage:null);Te.relevance>0&&(Ht+=le.relevance),it.__addSublanguage(le._emitter,le.language)}function z(){Te.subLanguage!=null?q():F(),Fe=""}function J(le,oe){le!==""&&(it.startScope(oe),it.addText(le),it.endScope())}function re(le,oe){let ye=1,Qe=oe.length-1;for(;ye<=Qe;){if(!le._emit[ye]){ye++;continue}let bt=Ue.classNameAliases[le[ye]]||le[ye],St=oe[ye];bt?J(St,bt):(Fe=St,F(),Fe=""),ye++}}function ee(le,oe){return le.scope&&typeof le.scope=="string"&&it.openNode(Ue.classNameAliases[le.scope]||le.scope),le.beginScope&&(le.beginScope._wrap?(J(Fe,Ue.classNameAliases[le.beginScope._wrap]||le.beginScope._wrap),Fe=""):le.beginScope._multi&&(re(le.beginScope,oe),Fe="")),Te=Object.create(le,{parent:{value:Te}}),Te}function G(le,oe,ye){let Qe=RM(le.endRe,ye);if(Qe){if(le["on:end"]){let bt=new Ad(le);le["on:end"](oe,bt),bt.isMatchIgnored&&(Qe=!1)}if(Qe){for(;le.endsParent&&le.parent;)le=le.parent;return le}}if(le.endsWithParent)return G(le.parent,oe,ye)}function X(le){return Te.matcher.regexIndex===0?(Fe+=le[0],1):(qt=!0,0)}function Q(le){let oe=le[0],ye=le.rule,Qe=new Ad(ye),bt=[ye.__beforeBegin,ye["on:begin"]];for(let St of bt)if(St&&(St(le,Qe),Qe.isMatchIgnored))return X(oe);return ye.skip?Fe+=oe:(ye.excludeBegin&&(Fe+=oe),z(),!ye.returnBegin&&!ye.excludeBegin&&(Fe=oe)),ee(ye,le),ye.returnBegin?0:oe.length}function ce(le){let oe=le[0],ye=U.substring(le.index),Qe=G(Te,le,ye);if(!Qe)return XE;let bt=Te;Te.endScope&&Te.endScope._wrap?(z(),J(oe,Te.endScope._wrap)):Te.endScope&&Te.endScope._multi?(z(),re(Te.endScope,le)):bt.skip?Fe+=oe:(bt.returnEnd||bt.excludeEnd||(Fe+=oe),z(),bt.excludeEnd&&(Fe=oe));do Te.scope&&it.closeNode(),!Te.skip&&!Te.subLanguage&&(Ht+=Te.relevance),Te=Te.parent;while(Te!==Qe.parent);return Qe.starts&&ee(Qe.starts,le),bt.returnEnd?0:oe.length}function j(){let le=[];for(let oe=Te;oe!==Ue;oe=oe.parent)oe.scope&&le.unshift(oe.scope);le.forEach(oe=>it.openNode(oe))}let we={};function $e(le,oe){let ye=oe&&oe[0];if(Fe+=le,ye==null)return z(),0;if(we.type==="begin"&&oe.type==="end"&&we.index===oe.index&&ye===""){if(Fe+=U.slice(oe.index,oe.index+1),!r){let Qe=new Error(`0 width match regex (${O})`);throw Qe.languageName=O,Qe.badRule=we.rule,Qe}return 1}if(we=oe,oe.type==="begin")return Q(oe);if(oe.type==="illegal"&&!L){let Qe=new Error('Illegal lexeme "'+ye+'" for mode "'+(Te.scope||"<unnamed>")+'"');throw Qe.mode=Te,Qe}else if(oe.type==="end"){let Qe=ce(oe);if(Qe!==XE)return Qe}if(oe.type==="illegal"&&ye==="")return Fe+=`
4
4
  `,1;if(st>1e5&&st>oe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Fe+=ye,ye.length}let Ue=_(O);if(!Ue)throw zs(s.replace("{}",O)),new Error('Unknown language: "'+O+'"');let Le=aD(Ue),ct="",Te=H||Le,Pe={},it=new a.__emitter(a);j();let Fe="",Ht=0,mo=0,st=0,qt=!1;try{if(Ue.__emitTokens)Ue.__emitTokens(U,it);else{for(Te.matcher.considerAll();;){st++,qt?qt=!1:Te.matcher.considerAll(),Te.matcher.lastIndex=mo;let le=Te.matcher.exec(U);if(!le)break;let oe=U.substring(mo,le.index),ye=$e(oe,le);mo=le.index+ye}$e(U.substring(mo))}return it.finalize(),ct=it.toHTML(),{language:O,value:ct,relevance:Ht,illegal:!1,_emitter:it,_top:Te}}catch(le){if(le.message&&le.message.includes("Illegal"))return{language:O,value:$f(U),illegal:!0,relevance:0,_illegalBy:{message:le.message,index:mo,context:U.slice(mo-100,mo+100),mode:le.mode,resultSoFar:ct},_emitter:it};if(r)return{language:O,value:$f(U),illegal:!1,relevance:0,errorRaised:le,_emitter:it,_top:Te};throw le}}function g(O){let U={value:$f(O),illegal:!1,relevance:0,_top:i,_emitter:new a.__emitter(a)};return U._emitter.addText(O),U}function b(O,U){U=U||a.languages||Object.keys(t);let L=g(O),H=U.filter(_).filter(N).map(z=>f(z,O,!1));H.unshift(L);let $=H.sort((z,J)=>{if(z.relevance!==J.relevance)return J.relevance-z.relevance;if(z.language&&J.language){if(_(z.language).supersetOf===J.language)return 1;if(_(J.language).supersetOf===z.language)return-1}return 0}),[K,F]=$,q=K;return q.secondBest=F,q}function h(O,U,L){let H=U&&o[U]||L;O.classList.add("hljs"),O.classList.add(`language-${H}`)}function y(O){let U=null,L=c(O);if(l(L))return;if(D("before:highlightElement",{el:O,language:L}),O.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",O);return}if(O.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(O)),a.throwUnescapedHTML))throw new zf("One of your code blocks includes unescaped HTML.",O.innerHTML);U=O;let H=U.textContent,$=L?m(H,{language:L,ignoreIllegals:!0}):b(H);O.innerHTML=$.value,O.dataset.highlighted="yes",h(O,L,$.language),O.result={language:$.language,re:$.relevance,relevance:$.relevance},$.secondBest&&(O.secondBest={language:$.secondBest.language,relevance:$.secondBest.relevance}),D("after:highlightElement",{el:O,result:$,text:H})}function S(O){a=YE(a,O)}let T=()=>{C(),Za("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function A(){C(),Za("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let w=!1;function C(){function O(){C()}if(document.readyState==="loading"){w||window.addEventListener("DOMContentLoaded",O,!1),w=!0;return}document.querySelectorAll(a.cssSelector).forEach(y)}function I(O,U){let L=null;try{L=U(e)}catch(H){if(zs("Language definition for '{}' could not be registered.".replace("{}",O)),r)zs(H);else throw H;L=i}L.name||(L.name=O),t[O]=L,L.rawDefinition=U.bind(null,e),L.aliases&&R(L.aliases,{languageName:O})}function x(O){delete t[O];for(let U of Object.keys(o))o[U]===O&&delete o[U]}function v(){return Object.keys(t)}function _(O){return O=(O||"").toLowerCase(),t[O]||t[o[O]]}function R(O,{languageName:U}){typeof O=="string"&&(O=[O]),O.forEach(L=>{o[L.toLowerCase()]=U})}function N(O){let U=_(O);return U&&!U.disableAutodetect}function k(O){O["before:highlightBlock"]&&!O["before:highlightElement"]&&(O["before:highlightElement"]=U=>{O["before:highlightBlock"](Object.assign({block:U.el},U))}),O["after:highlightBlock"]&&!O["after:highlightElement"]&&(O["after:highlightElement"]=U=>{O["after:highlightBlock"](Object.assign({block:U.el},U))})}function W(O){k(O),n.push(O)}function P(O){let U=n.indexOf(O);U!==-1&&n.splice(U,1)}function D(O,U){let L=O;n.forEach(function(H){H[L]&&H[L](U)})}function B(O){return Za("10.7.0","highlightBlock will be removed entirely in v12.0"),Za("10.7.0","Please use highlightElement now."),y(O)}Object.assign(e,{highlight:m,highlightAuto:b,highlightAll:C,highlightElement:y,highlightBlock:B,configure:S,initHighlighting:T,initHighlightingOnLoad:A,registerLanguage:I,unregisterLanguage:x,listLanguages:v,getLanguage:_,registerAliases:R,autoDetection:N,inherit:YE,addPlugin:W,removePlugin:P}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=cD,e.regex={concat:Ys,lookahead:JE,either:Yf,optional:vM,anyNumberOfTimes:_M};for(let O in Rd)typeof Rd[O]=="object"&&jE(Rd[O]);return Object.assign(e,Rd),e},el=aC({});el.newInstance=()=>aC({});lC.exports=el;el.HighlightJS=el;el.default=el});var x_=at(Tt=>{"use strict";var vo=typeof Symbol=="function"&&Symbol.for,Tg=vo?Symbol.for("react.element"):60103,xg=vo?Symbol.for("react.portal"):60106,tm=vo?Symbol.for("react.fragment"):60107,om=vo?Symbol.for("react.strict_mode"):60108,nm=vo?Symbol.for("react.profiler"):60114,rm=vo?Symbol.for("react.provider"):60109,im=vo?Symbol.for("react.context"):60110,Eg=vo?Symbol.for("react.async_mode"):60111,sm=vo?Symbol.for("react.concurrent_mode"):60111,am=vo?Symbol.for("react.forward_ref"):60112,lm=vo?Symbol.for("react.suspense"):60113,PD=vo?Symbol.for("react.suspense_list"):60120,cm=vo?Symbol.for("react.memo"):60115,um=vo?Symbol.for("react.lazy"):60116,kD=vo?Symbol.for("react.block"):60121,BD=vo?Symbol.for("react.fundamental"):60117,UD=vo?Symbol.for("react.responder"):60118,FD=vo?Symbol.for("react.scope"):60119;function Hn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Tg:switch(e=e.type,e){case Eg:case sm:case tm:case nm:case om:case lm:return e;default:switch(e=e&&e.$$typeof,e){case im:case am:case um:case cm:case rm:return e;default:return t}}case xg:return t}}}function T_(e){return Hn(e)===sm}Tt.AsyncMode=Eg;Tt.ConcurrentMode=sm;Tt.ContextConsumer=im;Tt.ContextProvider=rm;Tt.Element=Tg;Tt.ForwardRef=am;Tt.Fragment=tm;Tt.Lazy=um;Tt.Memo=cm;Tt.Portal=xg;Tt.Profiler=nm;Tt.StrictMode=om;Tt.Suspense=lm;Tt.isAsyncMode=function(e){return T_(e)||Hn(e)===Eg};Tt.isConcurrentMode=T_;Tt.isContextConsumer=function(e){return Hn(e)===im};Tt.isContextProvider=function(e){return Hn(e)===rm};Tt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Tg};Tt.isForwardRef=function(e){return Hn(e)===am};Tt.isFragment=function(e){return Hn(e)===tm};Tt.isLazy=function(e){return Hn(e)===um};Tt.isMemo=function(e){return Hn(e)===cm};Tt.isPortal=function(e){return Hn(e)===xg};Tt.isProfiler=function(e){return Hn(e)===nm};Tt.isStrictMode=function(e){return Hn(e)===om};Tt.isSuspense=function(e){return Hn(e)===lm};Tt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===tm||e===sm||e===nm||e===om||e===lm||e===PD||typeof e=="object"&&e!==null&&(e.$$typeof===um||e.$$typeof===cm||e.$$typeof===rm||e.$$typeof===im||e.$$typeof===am||e.$$typeof===BD||e.$$typeof===UD||e.$$typeof===FD||e.$$typeof===kD)};Tt.typeOf=Hn});var E_=at(xt=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,m=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,b=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,T=e?Symbol.for("react.responder"):60118,A=e?Symbol.for("react.scope"):60119;function w(j){return typeof j=="string"||typeof j=="function"||j===n||j===c||j===s||j===r||j===f||j===g||typeof j=="object"&&j!==null&&(j.$$typeof===h||j.$$typeof===b||j.$$typeof===i||j.$$typeof===a||j.$$typeof===m||j.$$typeof===S||j.$$typeof===T||j.$$typeof===A||j.$$typeof===y)}function C(j){if(typeof j=="object"&&j!==null){var we=j.$$typeof;switch(we){case t:var $e=j.type;switch($e){case l:case c:case n:case s:case r:case f:return $e;default:var Ue=$e&&$e.$$typeof;switch(Ue){case a:case m:case h:case b:case i:return Ue;default:return we}}case o:return we}}}var I=l,x=c,v=a,_=i,R=t,N=m,k=n,W=h,P=b,D=o,B=s,O=r,U=f,L=!1;function H(j){return L||(L=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),$(j)||C(j)===l}function $(j){return C(j)===c}function K(j){return C(j)===a}function F(j){return C(j)===i}function q(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function z(j){return C(j)===m}function J(j){return C(j)===n}function re(j){return C(j)===h}function ee(j){return C(j)===b}function G(j){return C(j)===o}function X(j){return C(j)===s}function Q(j){return C(j)===r}function ce(j){return C(j)===f}xt.AsyncMode=I,xt.ConcurrentMode=x,xt.ContextConsumer=v,xt.ContextProvider=_,xt.Element=R,xt.ForwardRef=N,xt.Fragment=k,xt.Lazy=W,xt.Memo=P,xt.Portal=D,xt.Profiler=B,xt.StrictMode=O,xt.Suspense=U,xt.isAsyncMode=H,xt.isConcurrentMode=$,xt.isContextConsumer=K,xt.isContextProvider=F,xt.isElement=q,xt.isForwardRef=z,xt.isFragment=J,xt.isLazy=re,xt.isMemo=ee,xt.isPortal=G,xt.isProfiler=X,xt.isStrictMode=Q,xt.isSuspense=ce,xt.isValidElementType=w,xt.typeOf=C}()});var _g=at((z$,Cg)=>{"use strict";process.env.NODE_ENV==="production"?Cg.exports=x_():Cg.exports=E_()});var v_=at((Y$,__)=>{"use strict";var C_=Object.getOwnPropertySymbols,HD=Object.prototype.hasOwnProperty,GD=Object.prototype.propertyIsEnumerable;function WD(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function $D(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},o=0;o<10;o++)t["_"+String.fromCharCode(o)]=o;var n=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(n.join("")!=="0123456789")return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(s){r[s]=s}),Object.keys(Object.assign({},r)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}__.exports=$D()?Object.assign:function(e,t){for(var o,n=WD(e),r,s=1;s<arguments.length;s++){o=Object(arguments[s]);for(var i in o)HD.call(o,i)&&(n[i]=o[i]);if(C_){r=C_(o);for(var a=0;a<r.length;a++)GD.call(o,r[a])&&(n[r[a]]=o[r[a]])}}return n}});var dm=at((X$,w_)=>{"use strict";var qD="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";w_.exports=qD});var vg=at((j$,R_)=>{R_.exports=Function.call.bind(Object.prototype.hasOwnProperty)});var M_=at((Q$,N_)=>{"use strict";var wg=function(){};process.env.NODE_ENV!=="production"&&(A_=dm(),mm={},I_=vg(),wg=function(e){var t="Warning: "+e;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}});var A_,mm,I_;function O_(e,t,o,n,r){if(process.env.NODE_ENV!=="production"){for(var s in e)if(I_(e,s)){var i;try{if(typeof e[s]!="function"){var a=Error((n||"React class")+": "+o+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}i=e[s](t,s,n,o,null,A_)}catch(c){i=c}if(i&&!(i instanceof Error)&&wg((n||"React class")+": type specification of "+o+" `"+s+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in mm)){mm[i.message]=!0;var l=r?r():"";wg("Failed "+o+" type: "+i.message+(l??""))}}}}O_.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(mm={})};N_.exports=O_});var P_=at((J$,L_)=>{"use strict";var KD=_g(),VD=v_(),ml=dm(),Rg=vg(),D_=M_(),pl=function(){};process.env.NODE_ENV!=="production"&&(pl=function(e){var t="Warning: "+e;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}});function pm(){return null}L_.exports=function(e,t){var o=typeof Symbol=="function"&&Symbol.iterator,n="@@iterator";function r(P){var D=P&&(o&&P[o]||P[n]);if(typeof D=="function")return D}var s="<<anonymous>>",i={array:m("array"),bigint:m("bigint"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:f(),arrayOf:g,element:b(),elementType:h(),instanceOf:y,node:w(),objectOf:T,oneOf:S,oneOfType:A,shape:I,exact:x};function a(P,D){return P===D?P!==0||1/P===1/D:P!==P&&D!==D}function l(P,D){this.message=P,this.data=D&&typeof D=="object"?D:{},this.stack=""}l.prototype=Error.prototype;function c(P){if(process.env.NODE_ENV!=="production")var D={},B=0;function O(L,H,$,K,F,q,z){if(K=K||s,q=q||$,z!==ml){if(t){var J=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw J.name="Invariant Violation",J}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var re=K+":"+$;!D[re]&&B<3&&(pl("You are manually calling a React.PropTypes validation function for the `"+q+"` prop on `"+K+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),D[re]=!0,B++)}}return H[$]==null?L?H[$]===null?new l("The "+F+" `"+q+"` is marked as required "+("in `"+K+"`, but its value is `null`.")):new l("The "+F+" `"+q+"` is marked as required in "+("`"+K+"`, but its value is `undefined`.")):null:P(H,$,K,F,q)}var U=O.bind(null,!1);return U.isRequired=O.bind(null,!0),U}function m(P){function D(B,O,U,L,H,$){var K=B[O],F=R(K);if(F!==P){var q=N(K);return new l("Invalid "+L+" `"+H+"` of type "+("`"+q+"` supplied to `"+U+"`, expected ")+("`"+P+"`."),{expectedType:P})}return null}return c(D)}function f(){return c(pm)}function g(P){function D(B,O,U,L,H){if(typeof P!="function")return new l("Property `"+H+"` of component `"+U+"` has invalid PropType notation inside arrayOf.");var $=B[O];if(!Array.isArray($)){var K=R($);return new l("Invalid "+L+" `"+H+"` of type "+("`"+K+"` supplied to `"+U+"`, expected an array."))}for(var F=0;F<$.length;F++){var q=P($,F,U,L,H+"["+F+"]",ml);if(q instanceof Error)return q}return null}return c(D)}function b(){function P(D,B,O,U,L){var H=D[B];if(!e(H)){var $=R(H);return new l("Invalid "+U+" `"+L+"` of type "+("`"+$+"` supplied to `"+O+"`, expected a single ReactElement."))}return null}return c(P)}function h(){function P(D,B,O,U,L){var H=D[B];if(!KD.isValidElementType(H)){var $=R(H);return new l("Invalid "+U+" `"+L+"` of type "+("`"+$+"` supplied to `"+O+"`, expected a single ReactElement type."))}return null}return c(P)}function y(P){function D(B,O,U,L,H){if(!(B[O]instanceof P)){var $=P.name||s,K=W(B[O]);return new l("Invalid "+L+" `"+H+"` of type "+("`"+K+"` supplied to `"+U+"`, expected ")+("instance of `"+$+"`."))}return null}return c(D)}function S(P){if(!Array.isArray(P))return process.env.NODE_ENV!=="production"&&(arguments.length>1?pl("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):pl("Invalid argument supplied to oneOf, expected an array.")),pm;function D(B,O,U,L,H){for(var $=B[O],K=0;K<P.length;K++)if(a($,P[K]))return null;var F=JSON.stringify(P,function(z,J){var re=N(J);return re==="symbol"?String(J):J});return new l("Invalid "+L+" `"+H+"` of value `"+String($)+"` "+("supplied to `"+U+"`, expected one of "+F+"."))}return c(D)}function T(P){function D(B,O,U,L,H){if(typeof P!="function")return new l("Property `"+H+"` of component `"+U+"` has invalid PropType notation inside objectOf.");var $=B[O],K=R($);if(K!=="object")return new l("Invalid "+L+" `"+H+"` of type "+("`"+K+"` supplied to `"+U+"`, expected an object."));for(var F in $)if(Rg($,F)){var q=P($,F,U,L,H+"."+F,ml);if(q instanceof Error)return q}return null}return c(D)}function A(P){if(!Array.isArray(P))return process.env.NODE_ENV!=="production"&&pl("Invalid argument supplied to oneOfType, expected an instance of array."),pm;for(var D=0;D<P.length;D++){var B=P[D];if(typeof B!="function")return pl("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+k(B)+" at index "+D+"."),pm}function O(U,L,H,$,K){for(var F=[],q=0;q<P.length;q++){var z=P[q],J=z(U,L,H,$,K,ml);if(J==null)return null;J.data&&Rg(J.data,"expectedType")&&F.push(J.data.expectedType)}var re=F.length>0?", expected one of type ["+F.join(", ")+"]":"";return new l("Invalid "+$+" `"+K+"` supplied to "+("`"+H+"`"+re+"."))}return c(O)}function w(){function P(D,B,O,U,L){return v(D[B])?null:new l("Invalid "+U+" `"+L+"` supplied to "+("`"+O+"`, expected a ReactNode."))}return c(P)}function C(P,D,B,O,U){return new l((P||"React class")+": "+D+" type `"+B+"."+O+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+U+"`.")}function I(P){function D(B,O,U,L,H){var $=B[O],K=R($);if(K!=="object")return new l("Invalid "+L+" `"+H+"` of type `"+K+"` "+("supplied to `"+U+"`, expected `object`."));for(var F in P){var q=P[F];if(typeof q!="function")return C(U,L,H,F,N(q));var z=q($,F,U,L,H+"."+F,ml);if(z)return z}return null}return c(D)}function x(P){function D(B,O,U,L,H){var $=B[O],K=R($);if(K!=="object")return new l("Invalid "+L+" `"+H+"` of type `"+K+"` "+("supplied to `"+U+"`, expected `object`."));var F=VD({},B[O],P);for(var q in F){var z=P[q];if(Rg(P,q)&&typeof z!="function")return C(U,L,H,q,N(z));if(!z)return new l("Invalid "+L+" `"+H+"` key `"+q+"` supplied to `"+U+"`.\nBad object: "+JSON.stringify(B[O],null," ")+`
5
5
  Valid keys: `+JSON.stringify(Object.keys(P),null," "));var J=z($,q,U,L,H+"."+q,ml);if(J)return J}return null}return c(D)}function v(P){switch(typeof P){case"number":case"string":case"undefined":return!0;case"boolean":return!P;case"object":if(Array.isArray(P))return P.every(v);if(P===null||e(P))return!0;var D=r(P);if(D){var B=D.call(P),O;if(D!==P.entries){for(;!(O=B.next()).done;)if(!v(O.value))return!1}else for(;!(O=B.next()).done;){var U=O.value;if(U&&!v(U[1]))return!1}}else return!1;return!0;default:return!1}}function _(P,D){return P==="symbol"?!0:D?D["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&D instanceof Symbol:!1}function R(P){var D=typeof P;return Array.isArray(P)?"array":P instanceof RegExp?"object":_(D,P)?"symbol":D}function N(P){if(typeof P>"u"||P===null)return""+P;var D=R(P);if(D==="object"){if(P instanceof Date)return"date";if(P instanceof RegExp)return"regexp"}return D}function k(P){var D=N(P);switch(D){case"array":case"object":return"an "+D;case"boolean":case"date":case"regexp":return"a "+D;default:return D}}function W(P){return!P.constructor||!P.constructor.name?s:P.constructor.name}return i.checkPropTypes=D_,i.resetWarningCache=D_.resetWarningCache,i.PropTypes=i,i}});var F_=at((Z$,U_)=>{"use strict";var zD=dm();function k_(){}function B_(){}B_.resetWarningCache=k_;U_.exports=function(){function e(n,r,s,i,a,l){if(l!==zD){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:B_,resetWarningCache:k_};return o.PropTypes=o,o}});var W_=at((eq,Ag)=>{process.env.NODE_ENV!=="production"?(H_=_g(),G_=!0,Ag.exports=P_()(H_.isElement,G_)):Ag.exports=F_()();var H_,G_});var z_=at((tq,fm)=>{"use strict";var q_=ju(),YD=sT(),$_=/\s/g;function Ig(...e){let t=YD.apply(this,e),o=(n,r)=>XD(n?n.toString():"",t,r);return o.multiline=(n,r)=>jD(n?n.toString():"",t,r),o}var K_=(e,t,o)=>t.interpolation.toLowerCase()==="hsv"?e.hsv(o,t.hsvSpin.toLowerCase()):e.rgb(o);function XD(e,t,o){let n=V_(o),r=Math.max(e.replace($_,"").length,t.stops.length),s=K_(t,n,r),i="";for(let a of e)i+=a.match($_)?a:q_.hex(s.shift().toHex())(a);return i}function jD(e,t,o){let n=V_(o),r=e.split(`
@@ -115,7 +115,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
115
115
  `),await Qo())}Fo("authenticated")},[i,n,Fo,kn,Os]),hy=(0,Y.useCallback)(async V=>{try{if(kn(null),!V.trim()&&V.length>1){kn("API key cannot be empty string with length greater than 1.");return}await NS(V),await ny(),await n.refreshAuth(Ye.USE_GEMINI),Fo("authenticated")}catch(ge){kn(`Failed to save API key: ${ge instanceof Error?ge.message:String(ge)}`)}},[Fo,kn,ny,n]),yy=(0,Y.useCallback)(()=>{Fo("updating")},[Fo]);(0,Y.useEffect)(()=>{Rr==="authenticated"&&(Dn(n.getUserTier()),te(n.getUserPaidTier()))},[n,Rr]),(0,Y.useEffect)(()=>{if(i.merged.security.auth.enforcedType&&i.merged.security.auth.selectedType&&i.merged.security.auth.enforcedType!==i.merged.security.auth.selectedType)kn(`Authentication is enforced to be ${i.merged.security.auth.enforcedType}, but you are currently using ${i.merged.security.auth.selectedType}.`);else if(i.merged.security.auth.selectedType&&!i.merged.security.auth.useExternal){if(i.merged.security.auth.selectedType===Ye.USE_GEMINI)return;let V=md(i.merged.security.auth.selectedType);V&&kn(V)}},[i.merged.security.auth.selectedType,i.merged.security.auth.enforcedType,i.merged.security.auth.useExternal,kn]);let{isModelDialogOpen:Vp,openModelDialog:by,closeModelDialog:Sy}=SA(),{toggleVimEnabled:iN}=za(),zp=(0,Y.useRef)(()=>{}),[Aa,Ns]=(0,Y.useState)(!1),{cleanUiDetailsVisible:lu,setCleanUiDetailsVisible:Ty,toggleCleanUiDetailsVisible:xy,revealCleanUiDetailsTemporarily:cu}=ZO(),sN=(0,Y.useMemo)(()=>({openAuthDialog:()=>Fo("updating"),openThemeDialog:Jh,openEditorDialog:Vl,openPrivacyNotice:()=>C(!0),openSettingsDialog:jh,openSessionBrowser:au,openModelDialog:by,openAgentConfigDialog:vr,openPermissionsDialog:Ao,quit:V=>{A(V),setTimeout(async()=>{await Pr(),Vh.exit(0)},100)},setDebugMessage:S,toggleCorgiMode:()=>g(V=>!V),toggleDebugProfiler:oi,dispatchExtensionStateUpdate:va,addConfirmUpdateExtensionRequest:cr,toggleBackgroundShell:()=>{H.current(),$.current||(N(!0),K.current.size>1?zp.current(!0):zp.current(!1))},toggleShortcutsHelp:()=>Ns(V=>!V),setText:Is}),[Fo,Jh,Vl,jh,au,by,vr,A,S,C,g,va,Ao,cr,oi,Ns,Is]),{handleSlashCommand:ri,slashCommands:uu,pendingHistoryItems:du,commandContext:Ey,confirmationRequest:Ms}=EA(n,i,c.addItem,c.clearItems,c.loadHistory,zt,iN,_,sN,Ss,Z,_i,D),[jl,Cy]=(0,Y.useState)(null),[mu,_y]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{let V=ge=>{Cy({prompt:ge.prompt,onConfirm:he=>{Cy(null),ge.onConfirm(he)}})};return Ce.on(ze.ConsentRequest,V),()=>{Ce.off(ze.ConsentRequest,V)}},[]);let aN=(0,Y.useCallback)(async()=>{c.addItem({type:"info",text:"Refreshing hierarchical memory (GEMINI.md or other context files)..."},Date.now());try{let V,ge;if(n.isJitContextEnabled())await n.getContextManager()?.refresh(),V=_f(n.getUserMemory()),ge=n.getGeminiMdFileCount();else{let he=await qu(n);V=_f(he.memoryContent),ge=he.fileCount}c.addItem({type:"info",text:`Memory reloaded successfully. ${V.length>0?`Loaded ${V.length} characters from ${ge} file(s)`:"No memory content found"}`},Date.now()),n.getDebugMode()&&Ee.log(`[DEBUG] Refreshed memory content in config: ${V.substring(0,200)}...`)}catch(V){let ge=mr(V);c.addItem({type:"error",text:`Error refreshing memory: ${ge}`},Date.now()),Ee.warn("Error refreshing memory:",V)}},[n,c]),Yp=(0,Y.useRef)(()=>{}),lN=(0,Y.useCallback)(V=>{V?L(!0):(L(!1),Yp.current(!1))},[]);(0,Y.useEffect)(()=>{if(U){let V=c.history.findLast(he=>he.type==="user"),ge=be.at(-1);(!V||typeof V.text=="string"&&V.text===ge)&&(Yp.current(!0),L(!1))}},[U,be,c.history]);let pu=(0,Y.useRef)([]),[cN,vy]=(0,Y.useState)(0),Xp=(0,Y.useCallback)(()=>{if(pu.current.length===0)return null;let V=pu.current.join(`
116
116
  `);return pu.current=[],vy(0),V},[]);(0,Y.useEffect)(()=>{let V=(ge,he)=>{he==="user_steering"&&(pu.current.push(ge),vy(nt=>nt+1))};return n.injectionService.onInjection(V),()=>{n.injectionService.offInjection(V)}},[n]);let{streamingState:fo,submitQuery:Ia,initError:jp,pendingHistoryItems:fu,thought:Ql,cancelOngoingRequest:wy,pendingToolCalls:uN,handleApprovalModeChange:Ry,activePtyId:Oi,loopDetectionConfirmationRequest:gu,lastOutputTime:Qp,backgroundShellCount:Jp,isBackgroundShellVisible:Ar,toggleBackgroundShell:hu,backgroundCurrentShell:Ay,backgroundShells:Ir,dismissBackgroundShell:Iy,retryStatus:dN}=kA(n.getGeminiClient(),c.history,c.addItem,n,i,S,ri,z,fn,kn,aN,re,ee,lN,N,De,Ae,R,Xp),jo=(0,Y.useMemo)(()=>[...du,...fu],[du,fu]),mN=(0,Y.useMemo)(()=>Om(jo),[jo]);H.current=hu,$.current=Ar,K.current=Ir;let{activeBackgroundShellPid:Oy,setIsBackgroundShellListOpen:Ds,isBackgroundShellListOpen:Ny,setActiveBackgroundShellPid:My,backgroundShellHeight:Zp}=FO({backgroundShells:Ir,backgroundShellCount:Jp,isBackgroundShellVisible:Ar,activePtyId:Oi,embeddedShellFocused:R,setEmbeddedShellFocused:N,terminalHeight:Ae});zp.current=Ds;let Jl=(0,Y.useRef)(0);(0,Y.useEffect)(()=>{Jl.current=Qp},[Qp]);let{shouldShowFocusHint:pN,inactivityStatus:Dy}=WA({activePtyId:Oi,lastOutputTime:Qp,streamingState:fo,pendingToolCalls:uN,embeddedShellFocused:R,isInteractiveShellEnabled:n.isInteractiveShellEnabled()}),Ly=Dy==="action_required",Py=Dy==="silent_working",fN=(0,Y.useCallback)(V=>{Ry(V),lu||cu(Kh)},[Ry,lu,cu]),{isMcpReady:Zl}=IO(n),{messageQueue:yu,addMessage:ky,clearQueue:By,getQueuedMessagesText:Uy,popAllMessages:Fy}=AO({isConfigInitialized:Z,streamingState:fo,submitQuery:Ia,isMcpReady:Zl});Yp.current=(0,Y.useCallback)((V=!0)=>{if(Om(jo))return;if(Im(jo)){Oo.setText("");return}if(!V)return;let he=be.at(-1)||"",nt=Uy();nt&&(he=he?`${he}
117
117
 
118
- ${nt}`:nt,By()),he&&Oo.setText(he)},[Oo,be,Uy,By,jo]);let Hy=(0,Y.useCallback)(V=>{let ge=V.trim();ge&&(n.injectionService.addInjection(ge,"user_steering"),c.addItem({type:"hint",text:ge}))},[n,c]),ec=(0,Y.useCallback)(async V=>{a(),st(null),Fe||(Ht(!0),m||zt());let ge=gn(V.trim()),he=fo==="idle",nt=fo==="responding"||Im(jo);if(ge&&nt){let{commandToExecute:Mi}=Ha(V,uu??[]);if(Mi?.isSafeConcurrent){ri(V),de(V);return}}if(n.isModelSteeringEnabled()&&nt&&!ge){Hy(V),de(V);return}let nc=Z&&Zl;if(ge&&Z||he&&nc){if(!ge){let Mi=await IT(V,n);if(Mi.length>0){_y({files:Mi,onComplete:LN=>{_y(null),LN.allowed&&Mi.forEach(PN=>n.getWorkspaceContext().addReadOnlyPath(PN)),Ia(V)}}),de(V);return}}Ia(V)}else he&&!nc&&yu.length===0&&Ce.emitFeedback("info",Z?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),ky(V);de(V)},[ky,de,Ia,ri,uu,Zl,fo,yu.length,jo,n,Fe,Ht,m,zt,a,Hy,Z,st]),Gy=(0,Y.useCallback)(()=>{a(),st(null),c.clearItems(),ql(),zt()},[c,ql,zt,a,st]),{handleInput:Wy}=UA(Oo,ec),ef=!jp&&!v&&!qp&&(fo==="idle"||fo==="responding"||fo==="waiting_for_confirmation")&&!Yl,bu=(0,Y.useRef)(null),[gN,hN]=(0,Y.useState)(0),$y=(0,Y.useCallback)(V=>{if(bu.current&&(bu.current.disconnect(),bu.current=null),V){let ge=new jn(he=>{let nt=he[0];if(nt){let nc=Math.round(nt.contentRect.height);hN(Mi=>nc!==Mi?nc:Mi)}});ge.observe(V),bu.current=ge}},[]),tf=Math.max(0,Ae-gN-Zp-1);n.setShellExecutionConfig({terminalWidth:Math.floor(De*PB),terminalHeight:Math.max(Math.floor(tf-kB),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:Su,hasReceivedFocusEvent:yN}=XT(),qy=(0,Y.useMemo)(()=>{let V=i.merged.context.fileName;return V?Array.isArray(V)?V:[V]:Bb()},[i.merged.context.fileName]),of=(0,Y.useMemo)(()=>n.getQuestion(),[n]),Ky=(0,Y.useRef)(!1),Vy=n.getGeminiClient();(0,Y.useEffect)(()=>{of&&Z&&!Ky.current&&!Ra&&!Xl&&!zl&&!Kl&&!w&&Vy?.isInitialized?.()&&(ec(of),Ky.current=!0)},[of,Z,ec,Ra,Xl,zl,Kl,w,Vy]);let[bN,SN]=(0,Y.useState)(!1),[nf,TN]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{(async()=>{let he=(await Pi.getInstance()).getCurrentIde();TN(he||null)})()},[]);let Tu=!!(nf&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!bN),[xu,tc]=(0,Y.useState)(!1),[zy,xN]=(0,Y.useState)(!1),[Yy,EN]=(0,Y.useState)(!0),Xy=(0,Y.useCallback)(V=>{V>2&&qb(n),V>1&&ri("/quit",void 0,void 0,!1)},[n,ri]),{pressCount:jy,handlePress:Qy}=Il({windowMs:si,onRepeat:Xy}),{pressCount:Jy,handlePress:Zy}=Il({windowMs:si,onRepeat:Xy}),[Eu,eb]=(0,Y.useState)(),[tb,CN]=(0,Y.useState)(!1),[rf,_N]=(0,Y.useState)(!1),[ob,ii]=Fp(si),{isFolderTrustDialogOpen:sf,discoveryResults:nb,handleFolderTrustSelect:rb,isRestarting:ib}=$A(i,Le,c.addItem),af=n.getPolicyUpdateConfirmationRequest(),[lf,sb]=(0,Y.useState)(!!af),{needsRestart:ab,restartReason:lb}=gx(),cb=(0,Y.useRef)(!0);PO(n,Ue,c,D);let Ni=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let V=nt=>{ii({text:nt.message,type:nt.type})},ge=()=>{ii({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},he=()=>{ii({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return Mo.on("transient-message",V),Mo.on("selection-warning",ge),Mo.on("paste-timeout",he),()=>{Mo.off("transient-message",V),Mo.off("selection-warning",ge),Mo.off("paste-timeout",he),Ni.current&&clearTimeout(Ni.current)}},[ii]);let cf=(0,Y.useCallback)(V=>{ii({text:V,type:"warning"})},[ii]),{handleSuspend:ub}=$O({handleWarning:cf,setRawMode:qe,refreshStatic:zt,setForceRerenderKey:h,shouldUseAlternateScreen:Hp});(0,Y.useEffect)(()=>{ab&&_N(!0)},[ab]),(0,Y.useEffect)(()=>{if(cb.current){cb.current=!1;return}let V=setTimeout(()=>{zt()},300);return()=>{clearTimeout(V)}},[De,zt]),(0,Y.useEffect)(()=>{let V=Tf.subscribe(eb);return eb(Tf.get()),V},[]),(0,Y.useEffect)(()=>{let V=()=>{tc(!0),Ht(!1)};return Mo.on("open-debug-console",V),()=>{Mo.off("open-debug-console",V)}},[n]);let db=(0,Y.useCallback)(V=>{CN(V)},[]),mb=(0,Y.useCallback)(V=>{V.userSelection==="yes"?(ri("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):V.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),SN(!0)},[ri,i]),vN=(0,Y.useCallback)(V=>{if(i.merged.general.debugKeystrokeLogging&&Ee.log("[DEBUG] Keystroke:",JSON.stringify(V)),Aa&&t(V)&&Ns(!1),m&&o["app.toggleCopyMode"](V))return O(!0),ks(),!0;if(o["basic.quit"](V))return wy?.(),Qy(),!0;if(o["basic.exit"](V))return ni.current.text.length>0?!1:(Zy(),!0);if(o["app.suspend"](V))ub();else if(o["app.toggleCopyMode"](V)&&!m)return ii({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0;let ge=!1;if(Fe||(ge=!0,Ht(!0),o["app.showMoreLines"](V)&&st(!0),m||zt()),o["app.showErrorDetails"](V))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:he}=await import("./devtoolsService-JSKAKMKA.js");await he(n,xu,()=>tc(nt=>!nt),()=>tc(!0))})():tc(he=>!he),!0;if(o["app.showFullTodos"](V))return xN(he=>!he),!0;if(o["app.toggleMarkdown"](V))return EN(he=>{let nt=!he;return zt(),nt}),!0;if(o["app.showIdeContextDetail"](V)&&n.getIdeMode()&&Eu)return ri("/ide status"),!0;if(o["app.showMoreLines"](V)&&!ge)return Ht(!1),st(!0),m||zt(),!0;if((o["app.focusShellInput"](V)||o["background.unfocusList"](V))&&(Oi||Ar&&Ir.size>0)){if(R){let nt=Jl.current;return Ni.current&&clearTimeout(Ni.current),Ni.current=setTimeout(()=>{Jl.current===nt?N(!1):ii({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-Jl.current>=100&&!Oi&&!Ar?(Ni.current&&clearTimeout(Ni.current),hu(),N(!0),Ir.size>1&&Ds(!0),!0):(N(!0),!0)}else{if(o["app.unfocusShellInput"](V)||o["background.unfocus"](V))return R?(N(!1),!0):!1;if(o["background.toggle"](V))return Oi?Ay():(hu(),!Ar&&Ir.size>0?(N(!0),Ir.size>1&&Ds(!0)):N(!1)),!0;if(o["background.toggleList"](V))return Ir.size>0&&Ar&&(R||N(!0),Ds(!0)),!0}return!1},[Fe,Ht,tc,n,Eu,Qy,Zy,ri,wy,Oi,ub,R,i.merged.general.debugKeystrokeLogging,zt,O,Ni,m,Aa,Ay,hu,Ir,Ar,Ds,Jl,ii,i.merged.general.devtools,xu,st,o,t]);pe(vN,{isActive:!0,priority:!0}),pe(V=>o["scroll.up"](V)||o["scroll.down"](V)||o["scroll.pageUp"](V)||o["scroll.pageDown"](V)||o["scroll.home"](V)||o["scroll.end"](V)?!1:(O(!1),Ps(),!0),{isActive:B,priority:200}),(0,Y.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let V=hp({streamingState:fo,thoughtSubject:Ql?.subject,isConfirming:!!Ms||Ly,isSilentWorking:Py,folderName:LB(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});Vt.current!==V&&(Vt.current=V,Se.write(`\x1B]0;${V}\x07`))},[fo,Ql,Ms,Ly,Py,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,Se]),(0,Y.useEffect)(()=>{let V=ge=>{let he;switch(ge.severity){case"error":he="error";break;case"warning":he="warning";break;case"info":he="info";break;default:throw new Error(`Unexpected severity for user feedback: ${ge.severity}`)}c.addItem({type:he,text:ge.message},Date.now()),ge.error&&Ee.warn(`[Feedback Details for "${ge.message}"]`,ge.error)};return Ce.on(ze.UserFeedback,V),Ce.drainBacklogs(),()=>{Ce.off(ze.UserFeedback,V)}},[c]);let pb=e.version.includes("nightly"),fb=Tu||Tu||sf||lf||F||!!Ms||!!jl||!!mu||!!P||Ro.length>0||!!gu||zl||Wp||Vp||wi||Xo||Ra||Xl||Kl||w||rf||!!Yl||!!ru||!!iu||!!su||Kp||Rr==="awaiting_api_key_input"||!!Pe,gb=Ro.length>0,hb=!!gu,oc=mN||!!Ms||!!jl||gb||hb||!!Yl||!!ru||!!iu||!!su||!!P,Cu=i.merged.ui.loadingPhrases,wN=Cu==="tips"||Cu==="all",RN=Cu==="witty"||Cu==="all",AN=(!R||Ar)&&fo==="responding"&&!oc,_u=0;if(j.length>0&&i.merged.hooksConfig.notifications){let V=j.length>1?"Executing Hooks":"Executing Hook",ge=j.map(he=>he.name+(he.index&&he.total&&he.total>1?` (${he.index}/${he.total})`:"")).join(", ");_u=V.length+ge.length+10}else AN?_u=(Ql?.subject||"Waiting for model...").length+25:oc&&(_u=35);let IN=De-_u-5,{elapsedTime:yb,currentLoadingPhrase:bb,currentTip:Sb,currentWittyPhrase:Tb}=HA({streamingState:fo,shouldShowFocusHint:pN,retryStatus:dN,showTips:wN,showWit:RN,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:IN}),uf=n.isPlanEnabled()&&fo==="idle"&&!oc,xb=OO({config:n,addItem:c.addItem,onApprovalModeChange:fN,isActive:!R,allowPlanMode:uf});QO({notificationsEnabled:l,isFocused:Su,hasReceivedFocusEvent:yN,streamingState:fo,hasPendingActionRequired:oc,pendingHistoryItems:jo,commandConfirmationRequest:Ms,authConsentRequest:jl,permissionConfirmationRequest:mu,hasConfirmUpdateExtensionRequests:gb,hasLoopDetectionConfirmationRequest:hb});let Eb=ef&&fo==="idle"&&!oc;(0,Y.useEffect)(()=>{Aa&&!Eb&&Ns(!1)},[Aa,Eb,Ns]),(0,Y.useEffect)(()=>{if(!Z||!n.isModelSteeringEnabled()||fo!=="idle"||!Zl||Om(jo))return;let V=Xp();V&&Ia([{text:Vu(V)}])},[n,c,Z,Zl,fo,Ia,Xp,jo,cN]);let ON=(0,Y.useMemo)(()=>Nm(jo),[jo]),[Cb,NN]=(0,Y.useState)(n.getGeminiMdFileCount());(0,Y.useEffect)(()=>{let V=ge=>{NN(ge.fileCount)};return Ce.on(ze.MemoryChanged,V),()=>{Ce.off(ze.MemoryChanged,V)}},[]),(0,Y.useEffect)(()=>{let V=!0;return(async()=>{let[he,nt]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);V&&(bt(he),In(nt),_i(!0))})(),()=>{V=!1}},[n,zt]);let MN=(0,Y.useMemo)(()=>({history:c.history,historyManager:c,isThemeDialogOpen:zl,themeError:I,isAuthenticating:Ra,isConfigInitialized:Z,authError:ty,accountSuspensionInfo:ry,isAuthDialogOpen:Xl,isAwaitingApiKeyInput:Rr==="awaiting_api_key_input",apiKeyDefaultValue:oy,editorError:zh,isEditorDialogOpen:Kl,showPrivacyNotice:w,corgiMode:f,debugMessage:y,quittingMessages:T,isSettingsDialogOpen:Wp,isSessionBrowserOpen:Kp,isModelDialogOpen:Vp,isAgentConfigDialogOpen:wi,selectedAgentName:ur,selectedAgentDisplayName:Es,selectedAgentDefinition:_s,isPermissionsDialogOpen:Xo,permissionsDialogProps:vi,slashCommands:uu,pendingSlashCommandHistoryItems:du,commandContext:Ey,commandConfirmationRequest:Ms,authConsentRequest:jl,confirmUpdateExtensionRequests:Ro,loopDetectionConfirmationRequest:gu,permissionConfirmationRequest:mu,geminiMdFileCount:Cb,streamingState:fo,initError:jp,pendingGeminiHistoryItems:fu,thought:Ql,shellModeActive:z,userMessages:be,buffer:Oo,inputWidth:Vn,suggestionsWidth:As,isInputActive:ef,isResuming:qp,shouldShowIdePrompt:Tu,isFolderTrustDialogOpen:sf??!1,folderDiscoveryResults:nb,isPolicyUpdateDialogOpen:lf,policyUpdateConfirmationRequest:af,isTrustedFolder:Ue,constrainHeight:Fe,showErrorDetails:xu,showFullTodos:zy,ideContextState:Eu,renderMarkdown:Yy,ctrlCPressedOnce:jy>=1,ctrlDPressedOnce:Jy>=1,showEscapePrompt:tb,shortcutsHelpVisible:Aa,cleanUiDetailsVisible:lu,isFocused:Su,elapsedTime:yb,currentLoadingPhrase:bb,currentTip:Sb,currentWittyPhrase:Tb,historyRemountKey:G,activeHooks:j,messageQueue:yu,queueErrorMessage:ct,showApprovalModeIndicator:xb,allowPlanMode:uf,currentModel:vs,quota:{userTier:Ii,stats:wr,proQuotaRequest:Yl,validationRequest:ru,overageMenuRequest:iu,emptyWalletRequest:su},contextFileNames:qy,errorCount:Ln,availableTerminalHeight:tf,mainAreaWidth:Pn,staticAreaMaxItemHeight:zn,staticExtraHeight:pn,dialogsVisible:fb,pendingHistoryItems:jo,nightly:pb,branchName:jt,sessionStats:Io,terminalWidth:De,terminalHeight:Ae,mainControlsRef:$y,rootUiRef:po,currentIDE:nf,updateInfo:we,showIdeRestartPrompt:rf,ideTrustRestartReason:lb,isRestarting:ib,extensionsUpdateState:On,activePtyId:Oi,backgroundShellCount:Jp,isBackgroundShellVisible:Ar,embeddedShellFocused:R,showDebugProfiler:k,customDialog:P,copyModeEnabled:B,transientMessage:ob,bannerData:lr,bannerVisible:ar,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:Q,backgroundShells:Ir,activeBackgroundShellPid:Oy,backgroundShellHeight:Zp,isBackgroundShellListOpen:Ny,adminSettingsChanged:F,newAgents:Pe,showIsExpandableHint:qt,hintMode:n.isModelSteeringEnabled()&&Im(jo),hintBuffer:""}),[zl,I,Ra,Z,ty,ry,Xl,zh,Kl,w,f,y,T,Wp,Kp,Vp,wi,ur,Es,_s,Xo,vi,uu,du,Ey,Ms,jl,Ro,gu,mu,Cb,fo,jp,fu,Ql,z,be,Oo,Vn,As,ef,qp,Tu,sf,nb,lf,af,Ue,Fe,xu,zy,Eu,Yy,jy,Jy,tb,Aa,lu,Su,yb,bb,Sb,Tb,G,j,yu,ct,xb,uf,Ii,wr,Yl,ru,iu,su,qy,Ln,tf,Pn,zn,pn,fb,jo,pb,jt,Io,De,Ae,$y,po,nf,we,rf,lb,ib,vs,On,Oi,Jp,Ar,c,R,k,P,oy,Rr,B,ob,lr,ar,n,Q,Zp,Ny,Oy,Ir,F,Pe,qt]),_b=(0,Y.useCallback)(()=>C(!1),[C]),DN=(0,Y.useMemo)(()=>({handleThemeSelect:$p,closeThemeDialog:Zh,handleThemeHighlight:ey,handleAuthSelect:gy,setAuthState:Fo,onAuthError:kn,handleEditorSelect:Yh,exitEditorDialog:Xh,exitPrivacyNotice:_b,closeSettingsDialog:Qh,closeModelDialog:Sy,openAgentConfigDialog:vr,closeAgentConfigDialog:Ai,openPermissionsDialog:Ao,closePermissionsDialog:Ts,setShellModeActive:J,vimHandleInput:Wy,handleIdePromptComplete:mb,handleFolderTrustSelect:rb,setIsPolicyUpdateDialogOpen:sb,setConstrainHeight:Ht,onEscapePromptChange:db,refreshStatic:zt,handleFinalSubmit:ec,handleClearScreen:Gy,handleProQuotaChoice:ay,handleValidationChoice:ly,handleOverageMenuChoice:cy,handleEmptyWalletChoice:uy,openSessionBrowser:au,closeSessionBrowser:dy,handleResumeSession:my,handleDeleteSession:fy,setQueueErrorMessage:Te,popAllMessages:Fy,handleApiKeySubmit:hy,handleApiKeyCancel:yy,setBannerVisible:_i,setShortcutsHelpVisible:Ns,setCleanUiDetailsVisible:Ty,toggleCleanUiDetailsVisible:xy,revealCleanUiDetailsTemporarily:cu,handleWarning:cf,setEmbeddedShellFocused:N,dismissBackgroundShell:Iy,setActiveBackgroundShellPid:My,setIsBackgroundShellListOpen:Ds,setAuthContext:Os,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(Vh.send){let V=n.getRemoteAdminSettings();V&&Vh.send({type:"admin-settings-update",settings:V})}await Qo()},handleNewAgentsSelect:async V=>{if(Pe&&V==="acknowledge"){let ge=n.getAgentRegistry();try{await Promise.all(Pe.map(he=>ge.acknowledgeAgent(he)))}catch(he){Ee.error("Failed to acknowledge agents:",he),c.addItem({type:"error",text:`Failed to acknowledge agents: ${mr(he)}`},Date.now())}}it(null)},getPreferredEditor:fn,clearAccountSuspension:()=>{iy(null),Fo("updating")}}),[$p,Zh,ey,gy,Fo,kn,Yh,Xh,_b,Qh,Sy,vr,Ai,Ao,Ts,J,Wy,mb,rb,sb,Ht,db,zt,ec,Gy,ay,ly,cy,uy,au,dy,my,fy,Te,Fy,hy,yy,_i,Ns,Ty,xy,cu,cf,N,Iy,My,Ds,Os,iy,Pe,n,c,fn]);return Rr==="awaiting_google_login_restart"?(0,Ci.jsx)(HO,{onDismiss:()=>{Os({}),Fo("updating")},config:n}):(0,Ci.jsx)(od.Provider,{value:MN,children:(0,Ci.jsx)(yg.Provider,{value:DN,children:(0,Ci.jsx)(Va.Provider,{value:n,children:(0,Ci.jsx)(Mg.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,Ci.jsx)(Mv,{config:n,toolCalls:ON,children:(0,Ci.jsx)(ih.Provider,{value:Su,children:(0,Ci.jsx)(rA,{},`app-${b}`)})})})})})})};var An=E(M(),1);var UB=200;async function cie(e,t,o,n=process.cwd(),r,s){rR();let i=Bu(pd(e),e.getScreenReader()),a=i;a&&(Ps(),Bi(()=>{ks()}));let{matchers:l,errors:c}=await ZT();c.forEach(T=>{Ce.emitFeedback("warning",T)});let m=await AS();FB(BB(n),t);let f=new wT({onNewMessage:T=>{Ce.emitConsoleLog(T.type,T.content)},debugMode:e.getDebugMode()});f.patch(),Bi(f.cleanup);let{stdout:g,stderr:b}=Jb(),h=!!process.env.SHPOOL_SESSION_NAME,y=()=>(np(),(0,An.jsx)(jT.Provider,{value:t,children:(0,An.jsx)(ex,{value:l,children:(0,An.jsx)(QT,{config:e,children:(0,An.jsx)(GC,{mouseEventsEnabled:a,children:(0,An.jsx)(lA,{children:(0,An.jsx)(zC,{children:(0,An.jsx)(tl,{children:(0,An.jsx)(Q_,{children:(0,An.jsx)(Ex,{children:(0,An.jsx)(eN,{config:e,startupWarnings:o,version:m,resumedSessionData:r,initializationResult:s})})})})})})})})})}));h&&await new Promise(T=>setTimeout(T,100));let S=GT(process.env.DEBUG?(0,An.jsx)(tN.default.StrictMode,{children:(0,An.jsx)(y,{})}):(0,An.jsx)(y,{}),{stdout:g,stderr:b,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:T})=>{T>UB&&Kb(e,T),xx.reportFrameRendered()},patchConsole:!1,alternateBuffer:i,incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&(Da(),Bi(()=>{Pu()})),RO(t).then(T=>{Ox(T,t,e.getProjectRoot())}).catch(T=>{e.getDebugMode()&&Ee.warn("Update check failed:",T)}),Bi(()=>S.unmount()),Bi(TT())}function FB(e,t){if(!t.merged.ui.hideWindowTitle){let o=hp({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Bn(`\x1B]0;${o}\x07`),process.on("exit",()=>{Bn("\x1B]0;\x07")})}}export{cie as startInteractiveUI};
118
+ ${nt}`:nt,By()),he&&Oo.setText(he)},[Oo,be,Uy,By,jo]);let Hy=(0,Y.useCallback)(V=>{let ge=V.trim();ge&&(n.injectionService.addInjection(ge,"user_steering"),c.addItem({type:"hint",text:ge}))},[n,c]),ec=(0,Y.useCallback)(async V=>{a(),st(null),Fe||(Ht(!0),m||zt());let ge=gn(V.trim()),he=fo==="idle",nt=fo==="responding"||Im(jo);if(ge&&nt){let{commandToExecute:Mi}=Ha(V,uu??[]);if(Mi?.isSafeConcurrent){ri(V),de(V);return}}if(n.isModelSteeringEnabled()&&nt&&!ge){Hy(V),de(V);return}let nc=Z&&Zl;if(ge&&Z||he&&nc){if(!ge){let Mi=await IT(V,n);if(Mi.length>0){_y({files:Mi,onComplete:LN=>{_y(null),LN.allowed&&Mi.forEach(PN=>n.getWorkspaceContext().addReadOnlyPath(PN)),Ia(V)}}),de(V);return}}Ia(V)}else he&&!nc&&yu.length===0&&Ce.emitFeedback("info",Z?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),ky(V);de(V)},[ky,de,Ia,ri,uu,Zl,fo,yu.length,jo,n,Fe,Ht,m,zt,a,Hy,Z,st]),Gy=(0,Y.useCallback)(()=>{a(),st(null),c.clearItems(),ql(),zt()},[c,ql,zt,a,st]),{handleInput:Wy}=UA(Oo,ec),ef=!jp&&!v&&!qp&&(fo==="idle"||fo==="responding"||fo==="waiting_for_confirmation")&&!Yl,bu=(0,Y.useRef)(null),[gN,hN]=(0,Y.useState)(0),$y=(0,Y.useCallback)(V=>{if(bu.current&&(bu.current.disconnect(),bu.current=null),V){let ge=new jn(he=>{let nt=he[0];if(nt){let nc=Math.round(nt.contentRect.height);hN(Mi=>nc!==Mi?nc:Mi)}});ge.observe(V),bu.current=ge}},[]),tf=Math.max(0,Ae-gN-Zp-1);n.setShellExecutionConfig({terminalWidth:Math.floor(De*PB),terminalHeight:Math.max(Math.floor(tf-kB),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:Su,hasReceivedFocusEvent:yN}=XT(),qy=(0,Y.useMemo)(()=>{let V=i.merged.context.fileName;return V?Array.isArray(V)?V:[V]:Bb()},[i.merged.context.fileName]),of=(0,Y.useMemo)(()=>n.getQuestion(),[n]),Ky=(0,Y.useRef)(!1),Vy=n.getGeminiClient();(0,Y.useEffect)(()=>{of&&Z&&!Ky.current&&!Ra&&!Xl&&!zl&&!Kl&&!w&&Vy?.isInitialized?.()&&(ec(of),Ky.current=!0)},[of,Z,ec,Ra,Xl,zl,Kl,w,Vy]);let[bN,SN]=(0,Y.useState)(!1),[nf,TN]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{(async()=>{let he=(await Pi.getInstance()).getCurrentIde();TN(he||null)})()},[]);let Tu=!!(nf&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!bN),[xu,tc]=(0,Y.useState)(!1),[zy,xN]=(0,Y.useState)(!1),[Yy,EN]=(0,Y.useState)(!0),Xy=(0,Y.useCallback)(V=>{V>2&&qb(n),V>1&&ri("/quit",void 0,void 0,!1)},[n,ri]),{pressCount:jy,handlePress:Qy}=Il({windowMs:si,onRepeat:Xy}),{pressCount:Jy,handlePress:Zy}=Il({windowMs:si,onRepeat:Xy}),[Eu,eb]=(0,Y.useState)(),[tb,CN]=(0,Y.useState)(!1),[rf,_N]=(0,Y.useState)(!1),[ob,ii]=Fp(si),{isFolderTrustDialogOpen:sf,discoveryResults:nb,handleFolderTrustSelect:rb,isRestarting:ib}=$A(i,Le,c.addItem),af=n.getPolicyUpdateConfirmationRequest(),[lf,sb]=(0,Y.useState)(!!af),{needsRestart:ab,restartReason:lb}=gx(),cb=(0,Y.useRef)(!0);PO(n,Ue,c,D);let Ni=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let V=nt=>{ii({text:nt.message,type:nt.type})},ge=()=>{ii({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},he=()=>{ii({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return Mo.on("transient-message",V),Mo.on("selection-warning",ge),Mo.on("paste-timeout",he),()=>{Mo.off("transient-message",V),Mo.off("selection-warning",ge),Mo.off("paste-timeout",he),Ni.current&&clearTimeout(Ni.current)}},[ii]);let cf=(0,Y.useCallback)(V=>{ii({text:V,type:"warning"})},[ii]),{handleSuspend:ub}=$O({handleWarning:cf,setRawMode:qe,refreshStatic:zt,setForceRerenderKey:h,shouldUseAlternateScreen:Hp});(0,Y.useEffect)(()=>{ab&&_N(!0)},[ab]),(0,Y.useEffect)(()=>{if(cb.current){cb.current=!1;return}let V=setTimeout(()=>{zt()},300);return()=>{clearTimeout(V)}},[De,zt]),(0,Y.useEffect)(()=>{let V=Tf.subscribe(eb);return eb(Tf.get()),V},[]),(0,Y.useEffect)(()=>{let V=()=>{tc(!0),Ht(!1)};return Mo.on("open-debug-console",V),()=>{Mo.off("open-debug-console",V)}},[n]);let db=(0,Y.useCallback)(V=>{CN(V)},[]),mb=(0,Y.useCallback)(V=>{V.userSelection==="yes"?(ri("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):V.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),SN(!0)},[ri,i]),vN=(0,Y.useCallback)(V=>{if(i.merged.general.debugKeystrokeLogging&&Ee.log("[DEBUG] Keystroke:",JSON.stringify(V)),Aa&&t(V)&&Ns(!1),m&&o["app.toggleCopyMode"](V))return O(!0),ks(),!0;if(o["basic.quit"](V))return wy?.(),Qy(),!0;if(o["basic.exit"](V))return ni.current.text.length>0?!1:(Zy(),!0);if(o["app.suspend"](V))ub();else if(o["app.toggleCopyMode"](V)&&!m)return ii({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0;let ge=!1;if(Fe||(ge=!0,Ht(!0),o["app.showMoreLines"](V)&&st(!0),m||zt()),o["app.showErrorDetails"](V))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:he}=await import("./devtoolsService-F37ICBM5.js");await he(n,xu,()=>tc(nt=>!nt),()=>tc(!0))})():tc(he=>!he),!0;if(o["app.showFullTodos"](V))return xN(he=>!he),!0;if(o["app.toggleMarkdown"](V))return EN(he=>{let nt=!he;return zt(),nt}),!0;if(o["app.showIdeContextDetail"](V)&&n.getIdeMode()&&Eu)return ri("/ide status"),!0;if(o["app.showMoreLines"](V)&&!ge)return Ht(!1),st(!0),m||zt(),!0;if((o["app.focusShellInput"](V)||o["background.unfocusList"](V))&&(Oi||Ar&&Ir.size>0)){if(R){let nt=Jl.current;return Ni.current&&clearTimeout(Ni.current),Ni.current=setTimeout(()=>{Jl.current===nt?N(!1):ii({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-Jl.current>=100&&!Oi&&!Ar?(Ni.current&&clearTimeout(Ni.current),hu(),N(!0),Ir.size>1&&Ds(!0),!0):(N(!0),!0)}else{if(o["app.unfocusShellInput"](V)||o["background.unfocus"](V))return R?(N(!1),!0):!1;if(o["background.toggle"](V))return Oi?Ay():(hu(),!Ar&&Ir.size>0?(N(!0),Ir.size>1&&Ds(!0)):N(!1)),!0;if(o["background.toggleList"](V))return Ir.size>0&&Ar&&(R||N(!0),Ds(!0)),!0}return!1},[Fe,Ht,tc,n,Eu,Qy,Zy,ri,wy,Oi,ub,R,i.merged.general.debugKeystrokeLogging,zt,O,Ni,m,Aa,Ay,hu,Ir,Ar,Ds,Jl,ii,i.merged.general.devtools,xu,st,o,t]);pe(vN,{isActive:!0,priority:!0}),pe(V=>o["scroll.up"](V)||o["scroll.down"](V)||o["scroll.pageUp"](V)||o["scroll.pageDown"](V)||o["scroll.home"](V)||o["scroll.end"](V)?!1:(O(!1),Ps(),!0),{isActive:B,priority:200}),(0,Y.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let V=hp({streamingState:fo,thoughtSubject:Ql?.subject,isConfirming:!!Ms||Ly,isSilentWorking:Py,folderName:LB(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});Vt.current!==V&&(Vt.current=V,Se.write(`\x1B]0;${V}\x07`))},[fo,Ql,Ms,Ly,Py,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,Se]),(0,Y.useEffect)(()=>{let V=ge=>{let he;switch(ge.severity){case"error":he="error";break;case"warning":he="warning";break;case"info":he="info";break;default:throw new Error(`Unexpected severity for user feedback: ${ge.severity}`)}c.addItem({type:he,text:ge.message},Date.now()),ge.error&&Ee.warn(`[Feedback Details for "${ge.message}"]`,ge.error)};return Ce.on(ze.UserFeedback,V),Ce.drainBacklogs(),()=>{Ce.off(ze.UserFeedback,V)}},[c]);let pb=e.version.includes("nightly"),fb=Tu||Tu||sf||lf||F||!!Ms||!!jl||!!mu||!!P||Ro.length>0||!!gu||zl||Wp||Vp||wi||Xo||Ra||Xl||Kl||w||rf||!!Yl||!!ru||!!iu||!!su||Kp||Rr==="awaiting_api_key_input"||!!Pe,gb=Ro.length>0,hb=!!gu,oc=mN||!!Ms||!!jl||gb||hb||!!Yl||!!ru||!!iu||!!su||!!P,Cu=i.merged.ui.loadingPhrases,wN=Cu==="tips"||Cu==="all",RN=Cu==="witty"||Cu==="all",AN=(!R||Ar)&&fo==="responding"&&!oc,_u=0;if(j.length>0&&i.merged.hooksConfig.notifications){let V=j.length>1?"Executing Hooks":"Executing Hook",ge=j.map(he=>he.name+(he.index&&he.total&&he.total>1?` (${he.index}/${he.total})`:"")).join(", ");_u=V.length+ge.length+10}else AN?_u=(Ql?.subject||"Waiting for model...").length+25:oc&&(_u=35);let IN=De-_u-5,{elapsedTime:yb,currentLoadingPhrase:bb,currentTip:Sb,currentWittyPhrase:Tb}=HA({streamingState:fo,shouldShowFocusHint:pN,retryStatus:dN,showTips:wN,showWit:RN,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:IN}),uf=n.isPlanEnabled()&&fo==="idle"&&!oc,xb=OO({config:n,addItem:c.addItem,onApprovalModeChange:fN,isActive:!R,allowPlanMode:uf});QO({notificationsEnabled:l,isFocused:Su,hasReceivedFocusEvent:yN,streamingState:fo,hasPendingActionRequired:oc,pendingHistoryItems:jo,commandConfirmationRequest:Ms,authConsentRequest:jl,permissionConfirmationRequest:mu,hasConfirmUpdateExtensionRequests:gb,hasLoopDetectionConfirmationRequest:hb});let Eb=ef&&fo==="idle"&&!oc;(0,Y.useEffect)(()=>{Aa&&!Eb&&Ns(!1)},[Aa,Eb,Ns]),(0,Y.useEffect)(()=>{if(!Z||!n.isModelSteeringEnabled()||fo!=="idle"||!Zl||Om(jo))return;let V=Xp();V&&Ia([{text:Vu(V)}])},[n,c,Z,Zl,fo,Ia,Xp,jo,cN]);let ON=(0,Y.useMemo)(()=>Nm(jo),[jo]),[Cb,NN]=(0,Y.useState)(n.getGeminiMdFileCount());(0,Y.useEffect)(()=>{let V=ge=>{NN(ge.fileCount)};return Ce.on(ze.MemoryChanged,V),()=>{Ce.off(ze.MemoryChanged,V)}},[]),(0,Y.useEffect)(()=>{let V=!0;return(async()=>{let[he,nt]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);V&&(bt(he),In(nt),_i(!0))})(),()=>{V=!1}},[n,zt]);let MN=(0,Y.useMemo)(()=>({history:c.history,historyManager:c,isThemeDialogOpen:zl,themeError:I,isAuthenticating:Ra,isConfigInitialized:Z,authError:ty,accountSuspensionInfo:ry,isAuthDialogOpen:Xl,isAwaitingApiKeyInput:Rr==="awaiting_api_key_input",apiKeyDefaultValue:oy,editorError:zh,isEditorDialogOpen:Kl,showPrivacyNotice:w,corgiMode:f,debugMessage:y,quittingMessages:T,isSettingsDialogOpen:Wp,isSessionBrowserOpen:Kp,isModelDialogOpen:Vp,isAgentConfigDialogOpen:wi,selectedAgentName:ur,selectedAgentDisplayName:Es,selectedAgentDefinition:_s,isPermissionsDialogOpen:Xo,permissionsDialogProps:vi,slashCommands:uu,pendingSlashCommandHistoryItems:du,commandContext:Ey,commandConfirmationRequest:Ms,authConsentRequest:jl,confirmUpdateExtensionRequests:Ro,loopDetectionConfirmationRequest:gu,permissionConfirmationRequest:mu,geminiMdFileCount:Cb,streamingState:fo,initError:jp,pendingGeminiHistoryItems:fu,thought:Ql,shellModeActive:z,userMessages:be,buffer:Oo,inputWidth:Vn,suggestionsWidth:As,isInputActive:ef,isResuming:qp,shouldShowIdePrompt:Tu,isFolderTrustDialogOpen:sf??!1,folderDiscoveryResults:nb,isPolicyUpdateDialogOpen:lf,policyUpdateConfirmationRequest:af,isTrustedFolder:Ue,constrainHeight:Fe,showErrorDetails:xu,showFullTodos:zy,ideContextState:Eu,renderMarkdown:Yy,ctrlCPressedOnce:jy>=1,ctrlDPressedOnce:Jy>=1,showEscapePrompt:tb,shortcutsHelpVisible:Aa,cleanUiDetailsVisible:lu,isFocused:Su,elapsedTime:yb,currentLoadingPhrase:bb,currentTip:Sb,currentWittyPhrase:Tb,historyRemountKey:G,activeHooks:j,messageQueue:yu,queueErrorMessage:ct,showApprovalModeIndicator:xb,allowPlanMode:uf,currentModel:vs,quota:{userTier:Ii,stats:wr,proQuotaRequest:Yl,validationRequest:ru,overageMenuRequest:iu,emptyWalletRequest:su},contextFileNames:qy,errorCount:Ln,availableTerminalHeight:tf,mainAreaWidth:Pn,staticAreaMaxItemHeight:zn,staticExtraHeight:pn,dialogsVisible:fb,pendingHistoryItems:jo,nightly:pb,branchName:jt,sessionStats:Io,terminalWidth:De,terminalHeight:Ae,mainControlsRef:$y,rootUiRef:po,currentIDE:nf,updateInfo:we,showIdeRestartPrompt:rf,ideTrustRestartReason:lb,isRestarting:ib,extensionsUpdateState:On,activePtyId:Oi,backgroundShellCount:Jp,isBackgroundShellVisible:Ar,embeddedShellFocused:R,showDebugProfiler:k,customDialog:P,copyModeEnabled:B,transientMessage:ob,bannerData:lr,bannerVisible:ar,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:Q,backgroundShells:Ir,activeBackgroundShellPid:Oy,backgroundShellHeight:Zp,isBackgroundShellListOpen:Ny,adminSettingsChanged:F,newAgents:Pe,showIsExpandableHint:qt,hintMode:n.isModelSteeringEnabled()&&Im(jo),hintBuffer:""}),[zl,I,Ra,Z,ty,ry,Xl,zh,Kl,w,f,y,T,Wp,Kp,Vp,wi,ur,Es,_s,Xo,vi,uu,du,Ey,Ms,jl,Ro,gu,mu,Cb,fo,jp,fu,Ql,z,be,Oo,Vn,As,ef,qp,Tu,sf,nb,lf,af,Ue,Fe,xu,zy,Eu,Yy,jy,Jy,tb,Aa,lu,Su,yb,bb,Sb,Tb,G,j,yu,ct,xb,uf,Ii,wr,Yl,ru,iu,su,qy,Ln,tf,Pn,zn,pn,fb,jo,pb,jt,Io,De,Ae,$y,po,nf,we,rf,lb,ib,vs,On,Oi,Jp,Ar,c,R,k,P,oy,Rr,B,ob,lr,ar,n,Q,Zp,Ny,Oy,Ir,F,Pe,qt]),_b=(0,Y.useCallback)(()=>C(!1),[C]),DN=(0,Y.useMemo)(()=>({handleThemeSelect:$p,closeThemeDialog:Zh,handleThemeHighlight:ey,handleAuthSelect:gy,setAuthState:Fo,onAuthError:kn,handleEditorSelect:Yh,exitEditorDialog:Xh,exitPrivacyNotice:_b,closeSettingsDialog:Qh,closeModelDialog:Sy,openAgentConfigDialog:vr,closeAgentConfigDialog:Ai,openPermissionsDialog:Ao,closePermissionsDialog:Ts,setShellModeActive:J,vimHandleInput:Wy,handleIdePromptComplete:mb,handleFolderTrustSelect:rb,setIsPolicyUpdateDialogOpen:sb,setConstrainHeight:Ht,onEscapePromptChange:db,refreshStatic:zt,handleFinalSubmit:ec,handleClearScreen:Gy,handleProQuotaChoice:ay,handleValidationChoice:ly,handleOverageMenuChoice:cy,handleEmptyWalletChoice:uy,openSessionBrowser:au,closeSessionBrowser:dy,handleResumeSession:my,handleDeleteSession:fy,setQueueErrorMessage:Te,popAllMessages:Fy,handleApiKeySubmit:hy,handleApiKeyCancel:yy,setBannerVisible:_i,setShortcutsHelpVisible:Ns,setCleanUiDetailsVisible:Ty,toggleCleanUiDetailsVisible:xy,revealCleanUiDetailsTemporarily:cu,handleWarning:cf,setEmbeddedShellFocused:N,dismissBackgroundShell:Iy,setActiveBackgroundShellPid:My,setIsBackgroundShellListOpen:Ds,setAuthContext:Os,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(Vh.send){let V=n.getRemoteAdminSettings();V&&Vh.send({type:"admin-settings-update",settings:V})}await Qo()},handleNewAgentsSelect:async V=>{if(Pe&&V==="acknowledge"){let ge=n.getAgentRegistry();try{await Promise.all(Pe.map(he=>ge.acknowledgeAgent(he)))}catch(he){Ee.error("Failed to acknowledge agents:",he),c.addItem({type:"error",text:`Failed to acknowledge agents: ${mr(he)}`},Date.now())}}it(null)},getPreferredEditor:fn,clearAccountSuspension:()=>{iy(null),Fo("updating")}}),[$p,Zh,ey,gy,Fo,kn,Yh,Xh,_b,Qh,Sy,vr,Ai,Ao,Ts,J,Wy,mb,rb,sb,Ht,db,zt,ec,Gy,ay,ly,cy,uy,au,dy,my,fy,Te,Fy,hy,yy,_i,Ns,Ty,xy,cu,cf,N,Iy,My,Ds,Os,iy,Pe,n,c,fn]);return Rr==="awaiting_google_login_restart"?(0,Ci.jsx)(HO,{onDismiss:()=>{Os({}),Fo("updating")},config:n}):(0,Ci.jsx)(od.Provider,{value:MN,children:(0,Ci.jsx)(yg.Provider,{value:DN,children:(0,Ci.jsx)(Va.Provider,{value:n,children:(0,Ci.jsx)(Mg.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,Ci.jsx)(Mv,{config:n,toolCalls:ON,children:(0,Ci.jsx)(ih.Provider,{value:Su,children:(0,Ci.jsx)(rA,{},`app-${b}`)})})})})})})};var An=E(M(),1);var UB=200;async function cie(e,t,o,n=process.cwd(),r,s){rR();let i=Bu(pd(e),e.getScreenReader()),a=i;a&&(Ps(),Bi(()=>{ks()}));let{matchers:l,errors:c}=await ZT();c.forEach(T=>{Ce.emitFeedback("warning",T)});let m=await AS();FB(BB(n),t);let f=new wT({onNewMessage:T=>{Ce.emitConsoleLog(T.type,T.content)},debugMode:e.getDebugMode()});f.patch(),Bi(f.cleanup);let{stdout:g,stderr:b}=Jb(),h=!!process.env.SHPOOL_SESSION_NAME,y=()=>(np(),(0,An.jsx)(jT.Provider,{value:t,children:(0,An.jsx)(ex,{value:l,children:(0,An.jsx)(QT,{config:e,children:(0,An.jsx)(GC,{mouseEventsEnabled:a,children:(0,An.jsx)(lA,{children:(0,An.jsx)(zC,{children:(0,An.jsx)(tl,{children:(0,An.jsx)(Q_,{children:(0,An.jsx)(Ex,{children:(0,An.jsx)(eN,{config:e,startupWarnings:o,version:m,resumedSessionData:r,initializationResult:s})})})})})})})})})}));h&&await new Promise(T=>setTimeout(T,100));let S=GT(process.env.DEBUG?(0,An.jsx)(tN.default.StrictMode,{children:(0,An.jsx)(y,{})}):(0,An.jsx)(y,{}),{stdout:g,stderr:b,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:T})=>{T>UB&&Kb(e,T),xx.reportFrameRendered()},patchConsole:!1,alternateBuffer:i,incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&(Da(),Bi(()=>{Pu()})),RO(t).then(T=>{Ox(T,t,e.getProjectRoot())}).catch(T=>{e.getDebugMode()&&Ee.warn("Update check failed:",T)}),Bi(()=>S.unmount()),Bi(TT())}function FB(e,t){if(!t.merged.ui.hideWindowTitle){let o=hp({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Bn(`\x1B]0;${o}\x07`),process.on("exit",()=>{Bn("\x1B]0;\x07")})}}export{cie as startInteractiveUI};
119
119
  /**
120
120
  * @license
121
121
  * Copyright 2025 Google LLC
@@ -1,5 +1,5 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
- import{$j as A,Xj as a,Zj as p,_j as m,ak as T,bk as w,ck as y,dk as U,ek as C,oc as f,sf as g}from"./chunk-742OPB22.js";import{Id as l,Ud as k,b as o,na as d,zd as n}from"./chunk-SX66NO2U.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";var v=class extends a{config;agentName;agentCardUrl;type="oauth2";tokenStorage;cachedToken=null;authorizationUrl;tokenUrl;scopes;constructor(e,t,r,i){super(),this.config=e,this.agentName=t,this.agentCardUrl=i,this.tokenStorage=new m(d.getA2AOAuthTokensPath(),"gemini-cli-a2a"),this.authorizationUrl=e.authorization_url,this.tokenUrl=e.token_url,this.scopes=e.scopes,this.mergeAgentCardDefaults(r)}async initialize(){(!this.authorizationUrl||!this.tokenUrl)&&this.agentCardUrl&&await this.fetchAgentCardDefaults();let e=await this.tokenStorage.getCredentials(this.agentName);e&&!this.tokenStorage.isTokenExpired(e.token)&&(this.cachedToken=e.token,o.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`))}async headers(){if(this.cachedToken&&!this.tokenStorage.isTokenExpired(this.cachedToken))return{Authorization:`Bearer ${this.cachedToken.accessToken}`};if(this.cachedToken?.refreshToken&&this.tokenUrl&&this.config.client_id)try{let e=await C({clientId:this.config.client_id,clientSecret:this.config.client_secret,scopes:this.scopes},this.cachedToken.refreshToken,this.tokenUrl);return this.cachedToken=this.toOAuthToken(e,this.cachedToken.refreshToken),await this.persistToken(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}catch(e){o.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${n(e)}`),await this.tokenStorage.deleteCredentials(this.agentName)}return this.cachedToken=await this.authenticateInteractively(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}async shouldRetryWithHeaders(e,t){if(t.status!==401&&t.status!==403){this.authRetryCount=0;return}if(!(this.authRetryCount>=a.MAX_AUTH_RETRIES))return this.authRetryCount++,o.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"),this.cachedToken=null,await this.tokenStorage.deleteCredentials(this.agentName),this.headers()}mergeAgentCardDefaults(e){if(e?.securitySchemes){for(let t of Object.values(e.securitySchemes))if(t.type==="oauth2"&&t.flows.authorizationCode){let r=t.flows.authorizationCode;this.authorizationUrl??=r.authorizationUrl,this.tokenUrl??=r.tokenUrl,this.scopes??=Object.keys(r.scopes);break}}}async fetchAgentCardDefaults(){if(this.agentCardUrl)try{o.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);let t=await new p().resolve(this.agentCardUrl,"");this.mergeAgentCardDefaults(t)}catch(e){o.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${n(e)}`)}}async authenticateInteractively(){if(!this.config.client_id)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);if(!this.authorizationUrl||!this.tokenUrl)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);let e={clientId:this.config.client_id,clientSecret:this.config.client_secret,authorizationUrl:this.authorizationUrl,tokenUrl:this.tokenUrl,scopes:this.scopes},t=A(),r=w(e.redirectUri),i=T(t.state,r),s=await i.port,h=y(e,t,s,void 0);if(!await f(`Authentication required for A2A agent: '${this.agentName}'.`))throw new l("Authentication cancelled by user.");k.emitFeedback("info",`\u2192 Opening your browser for OAuth sign-in...
2
+ import{$j as A,Xj as a,Zj as p,_j as m,ak as T,bk as w,ck as y,dk as U,ek as C,oc as f,sf as g}from"./chunk-5NLMIA5F.js";import{Id as l,Ud as k,b as o,na as d,zd as n}from"./chunk-SX66NO2U.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";var v=class extends a{config;agentName;agentCardUrl;type="oauth2";tokenStorage;cachedToken=null;authorizationUrl;tokenUrl;scopes;constructor(e,t,r,i){super(),this.config=e,this.agentName=t,this.agentCardUrl=i,this.tokenStorage=new m(d.getA2AOAuthTokensPath(),"gemini-cli-a2a"),this.authorizationUrl=e.authorization_url,this.tokenUrl=e.token_url,this.scopes=e.scopes,this.mergeAgentCardDefaults(r)}async initialize(){(!this.authorizationUrl||!this.tokenUrl)&&this.agentCardUrl&&await this.fetchAgentCardDefaults();let e=await this.tokenStorage.getCredentials(this.agentName);e&&!this.tokenStorage.isTokenExpired(e.token)&&(this.cachedToken=e.token,o.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`))}async headers(){if(this.cachedToken&&!this.tokenStorage.isTokenExpired(this.cachedToken))return{Authorization:`Bearer ${this.cachedToken.accessToken}`};if(this.cachedToken?.refreshToken&&this.tokenUrl&&this.config.client_id)try{let e=await C({clientId:this.config.client_id,clientSecret:this.config.client_secret,scopes:this.scopes},this.cachedToken.refreshToken,this.tokenUrl);return this.cachedToken=this.toOAuthToken(e,this.cachedToken.refreshToken),await this.persistToken(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}catch(e){o.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${n(e)}`),await this.tokenStorage.deleteCredentials(this.agentName)}return this.cachedToken=await this.authenticateInteractively(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}async shouldRetryWithHeaders(e,t){if(t.status!==401&&t.status!==403){this.authRetryCount=0;return}if(!(this.authRetryCount>=a.MAX_AUTH_RETRIES))return this.authRetryCount++,o.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"),this.cachedToken=null,await this.tokenStorage.deleteCredentials(this.agentName),this.headers()}mergeAgentCardDefaults(e){if(e?.securitySchemes){for(let t of Object.values(e.securitySchemes))if(t.type==="oauth2"&&t.flows.authorizationCode){let r=t.flows.authorizationCode;this.authorizationUrl??=r.authorizationUrl,this.tokenUrl??=r.tokenUrl,this.scopes??=Object.keys(r.scopes);break}}}async fetchAgentCardDefaults(){if(this.agentCardUrl)try{o.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);let t=await new p().resolve(this.agentCardUrl,"");this.mergeAgentCardDefaults(t)}catch(e){o.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${n(e)}`)}}async authenticateInteractively(){if(!this.config.client_id)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);if(!this.authorizationUrl||!this.tokenUrl)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);let e={clientId:this.config.client_id,clientSecret:this.config.client_secret,authorizationUrl:this.authorizationUrl,tokenUrl:this.tokenUrl,scopes:this.scopes},t=A(),r=w(e.redirectUri),i=T(t.state,r),s=await i.port,h=y(e,t,s,void 0);if(!await f(`Authentication required for A2A agent: '${this.agentName}'.`))throw new l("Authentication cancelled by user.");k.emitFeedback("info",`\u2192 Opening your browser for OAuth sign-in...
3
3
 
4
4
  If the browser does not open, copy and paste this URL into your browser:
5
5
  ${h}
@@ -1,5 +1,5 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
- import{$j as A,Xj as a,Zj as p,_j as m,ak as T,bk as y,ck as v,dk as w,ek as C,oc as g,sf as f}from"./chunk-CN5ZY54S.js";import{Id as l,Ud as k,b as o,na as d,zd as i}from"./chunk-ALYGAQ7G.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";var U=class extends a{constructor(e,t,r,n){super();this.config=e;this.agentName=t;this.agentCardUrl=n;this.tokenStorage=new m(d.getA2AOAuthTokensPath(),"gemini-cli-a2a"),this.authorizationUrl=e.authorization_url,this.tokenUrl=e.token_url,this.scopes=e.scopes,this.mergeAgentCardDefaults(r)}type="oauth2";tokenStorage;cachedToken=null;authorizationUrl;tokenUrl;scopes;async initialize(){(!this.authorizationUrl||!this.tokenUrl)&&this.agentCardUrl&&await this.fetchAgentCardDefaults();let e=await this.tokenStorage.getCredentials(this.agentName);e&&!this.tokenStorage.isTokenExpired(e.token)&&(this.cachedToken=e.token,o.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`))}async headers(){if(this.cachedToken&&!this.tokenStorage.isTokenExpired(this.cachedToken))return{Authorization:`Bearer ${this.cachedToken.accessToken}`};if(this.cachedToken?.refreshToken&&this.tokenUrl&&this.config.client_id)try{let e=await C({clientId:this.config.client_id,clientSecret:this.config.client_secret,scopes:this.scopes},this.cachedToken.refreshToken,this.tokenUrl);return this.cachedToken=this.toOAuthToken(e,this.cachedToken.refreshToken),await this.persistToken(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}catch(e){o.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${i(e)}`),await this.tokenStorage.deleteCredentials(this.agentName)}return this.cachedToken=await this.authenticateInteractively(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}async shouldRetryWithHeaders(e,t){if(t.status!==401&&t.status!==403){this.authRetryCount=0;return}if(!(this.authRetryCount>=a.MAX_AUTH_RETRIES))return this.authRetryCount++,o.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"),this.cachedToken=null,await this.tokenStorage.deleteCredentials(this.agentName),this.headers()}mergeAgentCardDefaults(e){if(e?.securitySchemes){for(let t of Object.values(e.securitySchemes))if(t.type==="oauth2"&&t.flows.authorizationCode){let r=t.flows.authorizationCode;this.authorizationUrl??=r.authorizationUrl,this.tokenUrl??=r.tokenUrl,this.scopes??=Object.keys(r.scopes);break}}}async fetchAgentCardDefaults(){if(this.agentCardUrl)try{o.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);let t=await new p().resolve(this.agentCardUrl,"");this.mergeAgentCardDefaults(t)}catch(e){o.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${i(e)}`)}}async authenticateInteractively(){if(!this.config.client_id)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);if(!this.authorizationUrl||!this.tokenUrl)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);let e={clientId:this.config.client_id,clientSecret:this.config.client_secret,authorizationUrl:this.authorizationUrl,tokenUrl:this.tokenUrl,scopes:this.scopes},t=A(),r=y(e.redirectUri),n=T(t.state,r),s=await n.port,h=v(e,t,s,void 0);if(!await g(`Authentication required for A2A agent: '${this.agentName}'.`))throw new l("Authentication cancelled by user.");k.emitFeedback("info",`\u2192 Opening your browser for OAuth sign-in...
2
+ import{$j as A,Xj as a,Zj as p,_j as m,ak as T,bk as y,ck as v,dk as w,ek as C,oc as g,sf as f}from"./chunk-YYIHO5TB.js";import{Id as l,Ud as k,b as o,na as d,zd as i}from"./chunk-ALYGAQ7G.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";var U=class extends a{constructor(e,t,r,n){super();this.config=e;this.agentName=t;this.agentCardUrl=n;this.tokenStorage=new m(d.getA2AOAuthTokensPath(),"gemini-cli-a2a"),this.authorizationUrl=e.authorization_url,this.tokenUrl=e.token_url,this.scopes=e.scopes,this.mergeAgentCardDefaults(r)}type="oauth2";tokenStorage;cachedToken=null;authorizationUrl;tokenUrl;scopes;async initialize(){(!this.authorizationUrl||!this.tokenUrl)&&this.agentCardUrl&&await this.fetchAgentCardDefaults();let e=await this.tokenStorage.getCredentials(this.agentName);e&&!this.tokenStorage.isTokenExpired(e.token)&&(this.cachedToken=e.token,o.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`))}async headers(){if(this.cachedToken&&!this.tokenStorage.isTokenExpired(this.cachedToken))return{Authorization:`Bearer ${this.cachedToken.accessToken}`};if(this.cachedToken?.refreshToken&&this.tokenUrl&&this.config.client_id)try{let e=await C({clientId:this.config.client_id,clientSecret:this.config.client_secret,scopes:this.scopes},this.cachedToken.refreshToken,this.tokenUrl);return this.cachedToken=this.toOAuthToken(e,this.cachedToken.refreshToken),await this.persistToken(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}catch(e){o.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${i(e)}`),await this.tokenStorage.deleteCredentials(this.agentName)}return this.cachedToken=await this.authenticateInteractively(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}async shouldRetryWithHeaders(e,t){if(t.status!==401&&t.status!==403){this.authRetryCount=0;return}if(!(this.authRetryCount>=a.MAX_AUTH_RETRIES))return this.authRetryCount++,o.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"),this.cachedToken=null,await this.tokenStorage.deleteCredentials(this.agentName),this.headers()}mergeAgentCardDefaults(e){if(e?.securitySchemes){for(let t of Object.values(e.securitySchemes))if(t.type==="oauth2"&&t.flows.authorizationCode){let r=t.flows.authorizationCode;this.authorizationUrl??=r.authorizationUrl,this.tokenUrl??=r.tokenUrl,this.scopes??=Object.keys(r.scopes);break}}}async fetchAgentCardDefaults(){if(this.agentCardUrl)try{o.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);let t=await new p().resolve(this.agentCardUrl,"");this.mergeAgentCardDefaults(t)}catch(e){o.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${i(e)}`)}}async authenticateInteractively(){if(!this.config.client_id)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);if(!this.authorizationUrl||!this.tokenUrl)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);let e={clientId:this.config.client_id,clientSecret:this.config.client_secret,authorizationUrl:this.authorizationUrl,tokenUrl:this.tokenUrl,scopes:this.scopes},t=A(),r=y(e.redirectUri),n=T(t.state,r),s=await n.port,h=v(e,t,s,void 0);if(!await g(`Authentication required for A2A agent: '${this.agentName}'.`))throw new l("Authentication cancelled by user.");k.emitFeedback("info",`\u2192 Opening your browser for OAuth sign-in...
3
3
 
4
4
  If the browser does not open, copy and paste this URL into your browser:
5
5
  ${h}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makecoder",
3
- "version": "2.0.72",
3
+ "version": "2.0.77",
4
4
  "description": "MakeCoder: Unified AI agent CLI tool integrating Claude Code, Codex and Gemini CLI",
5
5
  "main": "./dist/coder.js",
6
6
  "bin": {
@@ -24,15 +24,20 @@
24
24
  ],
25
25
  "author": "makecoder",
26
26
  "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/makecoderai/coder.git"
30
+ },
31
+ "homepage": "https://github.com/makecoderai/coder",
27
32
  "dependencies": {
28
33
  "node-fetch": "^3.3.2",
29
34
  "open": "^10.1.0",
30
35
  "zod": "^3.25.76"
31
36
  },
32
37
  "optionalDependencies": {
33
- "makecoder-codex-darwin-arm64": "2.0.72",
34
- "makecoder-codex-linux-x64": "2.0.72",
35
- "makecoder-codex-win32-x64": "2.0.72"
38
+ "makecoder-codex-darwin-arm64": "2.0.77",
39
+ "makecoder-codex-linux-x64": "2.0.77",
40
+ "makecoder-codex-win32-x64": "2.0.77"
36
41
  },
37
42
  "engines": {
38
43
  "node": ">=20.0.0"
@@ -1,137 +0,0 @@
1
- # 飞书渠道接入
2
-
3
- 接入飞书(Feishu/Lark)企业自建应用,完成机器人配置。
4
-
5
- ---
6
-
7
- ## 常见踩坑
8
-
9
- ### 事件订阅保存失败
10
-
11
- **现象**:在飞书开放平台配置「长连接」事件订阅时保存失败。
12
-
13
- **原因**:「长连接」模式要求 OpenClaw 网关已启动且已添加 Feishu 渠道。
14
-
15
- **解决方案**:确保先完成 Step 5(插件安装 + 网关重启),再回来配置事件订阅。
16
-
17
- ---
18
-
19
- ## 飞书权限列表
20
-
21
- 在 Step 4 权限管理「批量导入」时使用以下 JSON:
22
-
23
- ```json
24
- {
25
- "scopes": {
26
- "tenant": [
27
- "aily:file:read",
28
- "aily:file:write",
29
- "application:application.app_message_stats.overview:readonly",
30
- "application:application:self_manage",
31
- "application:bot.menu:write",
32
- "cardkit:card:write",
33
- "contact:user.employee_id:readonly",
34
- "corehr:file:download",
35
- "docs:document.content:read",
36
- "event:ip_list",
37
- "im:chat",
38
- "im:chat.access_event.bot_p2p_chat:read",
39
- "im:chat.members:bot_access",
40
- "im:message",
41
- "im:message.group_at_msg:readonly",
42
- "im:message.group_msg",
43
- "im:message.p2p_msg:readonly",
44
- "im:message:readonly",
45
- "im:message:send_as_bot",
46
- "im:resource",
47
- "sheets:spreadsheet",
48
- "wiki:wiki:readonly"
49
- ],
50
- "user": [
51
- "aily:file:read",
52
- "aily:file:write",
53
- "im:chat.access_event.bot_p2p_chat:read"
54
- ]
55
- }
56
- }
57
- ```
58
-
59
- ---
60
-
61
- ## Step 4:创建飞书应用
62
-
63
- > 若用户明确指定使用已有应用,跳过创建,直接让用户提供凭据进入 Step 5。
64
-
65
- 请用户按以下步骤在飞书开放平台手动完成应用创建:
66
-
67
- 1. 打开 [飞书开放平台](https://open.feishu.cn/app?lang=zh-CN),登录后点击「创建企业自建应用」
68
- 2. 填写应用名称 `OpenClaw`、描述 `OpenClaw`,随机选择图标,完成创建
69
- 3. 在「凭证与基础信息」页面找到并复制 **App ID**(格式 `cli_xxx`)和 **App Secret**
70
- 4. 在「应用能力 > 添加应用能力」页面添加机器人能力
71
- 5. 在「开发配置 > 权限管理」页面点击「批量导入」,粘贴上方「飞书权限列表」中的 JSON 并确认
72
-
73
- 完成后,请将 **App ID** 和 **App Secret** 粘贴给我。
74
-
75
- **等待用户提供 App ID 和 App Secret,收到后继续执行 Step 5。**
76
-
77
- ---
78
-
79
- ## Step 5:安装插件,写入飞书凭据,重启网关
80
-
81
- 首先执行插件安装(如插件已存在则执行 update):
82
-
83
- ```bash
84
- openclaw plugins install @openclaw/feishu
85
- # 若插件已存在:
86
- # openclaw plugins update @openclaw/feishu
87
- ```
88
-
89
- 安装完成后,使用 Read + Edit/Write 工具修改 `~/.openclaw/openclaw.json`,填写 `channels.feishu`:
90
-
91
- ```json
92
- "channels": {
93
- "feishu": {
94
- "appId": "<APP_ID>",
95
- "appSecret": "<APP_SECRET>",
96
- "enabled": true,
97
- "requireMention": true,
98
- "allowFrom": [],
99
- "chunkMode": "length",
100
- "connectionMode": "websocket",
101
- "dmPolicy": "pairing",
102
- "domain": "feishu",
103
- "groupPolicy": "open"
104
- }
105
- }
106
- ```
107
-
108
- 写入完成后重启网关:
109
-
110
- ```bash
111
- openclaw gateway restart
112
- ```
113
-
114
- ---
115
-
116
- ## Step 6:配置飞书事件订阅
117
-
118
- > 确保 Step 5 已完成(网关已启动),否则长连接保存会失败。详见上方"事件订阅保存失败"踩坑。
119
-
120
- 请用户在飞书开放平台「事件与回调」页面手动完成以下配置:
121
-
122
- 1. 在「开发配置 > 事件与回调」页面点击「事件配置」,点击「订阅方式」选择「使用长连接接收事件」,然后点击「添加事件」 输入`im.message.receive_v1`保存
123
- 2. 在「开发配置 > 事件与回调」页面点击「回调配置」,点击「订阅方式」选择「使用长连接接收事件」
124
- 3. 在「应用发布 > 版本管理与发布」页面进行发布版本
125
-
126
- 完成后请告知我,我将继续执行后续步骤。
127
-
128
- **等待用户确认完成,收到确认后再继续执行 Step 7。**
129
-
130
- ---
131
-
132
- ## Step 7:提示用户将机器人加入群组
133
-
134
- 将下列步骤提示给用户:
135
-
136
- 1. 打开飞书APP 进入目标群聊 → 右上角「设置」→「群机器人」→「添加机器人」→ 搜索 `OpenClaw` 并添加
137
- 2. @机器人发送消息
@@ -1,60 +0,0 @@
1
- # QQ 渠道接入
2
-
3
- 接入 QQ 机器人(QQBot),完成 OpenClaw 渠道配置。
4
-
5
- ---
6
-
7
- ## Step 4:创建 QQ 机器人
8
-
9
- 请用户按以下步骤在 QQ 开放平台手动完成机器人创建:
10
-
11
- 1. 打开 [QQ 机器人开放平台](https://q.qq.com/qqbot/openclaw/index.html),完成登录
12
- 2. 点击【创建机器人】
13
- 3. 按照页面引导填写机器人信息,完成创建
14
- 4. 在机器人详情页找到并复制 **AppID** 和 **AppSecret**
15
-
16
- 完成后,请将 **AppID** 和 **AppSecret** 粘贴给我。
17
-
18
- **等待用户提供 AppID 和 AppSecret,收到后继续执行 Step 5。**
19
-
20
- ---
21
-
22
- ## Step 5:安装插件,写入 QQ 凭据,重启网关
23
-
24
- 首先执行插件安装(如插件已存在则执行 update):
25
-
26
- ```bash
27
- openclaw plugins install @tencent-connect/openclaw-qqbot@latest
28
- # 若插件已存在:
29
- # openclaw plugins update @tencent-connect/openclaw-qqbot
30
- ```
31
-
32
- 安装完成后,使用 Read + Edit/Write 工具修改 `~/.openclaw/openclaw.json`,填写 `channels.qqbot`:
33
-
34
- ```json
35
- "channels": {
36
- "qqbot": {
37
- "enabled": true,
38
- "allowFrom": [
39
- "*"
40
- ],
41
- "appId": "<APP_ID>",
42
- "clientSecret": "<APP_SECRET>"
43
- }
44
- }
45
- ```
46
-
47
- 写入完成后重启网关:
48
-
49
- ```bash
50
- openclaw gateway restart
51
- ```
52
-
53
- ---
54
-
55
- ## Step 6:提示用户配置完成
56
-
57
- 将下列步骤提示给用户:
58
-
59
- 1. QQ 机器人渠道已创建成功!
60
- 2. 在 QQ 中找到你的机器人,直接发送消息即可开始使用
@@ -1,64 +0,0 @@
1
- # 企业微信渠道接入
2
-
3
- 接入企业微信智能机器人(API 模式),完成 OpenClaw 渠道配置。
4
-
5
- ---
6
-
7
- ## Step 4:创建企业微信智能机器人
8
-
9
- 请按以下步骤在企业微信手动完成机器人创建:
10
-
11
- 1. 打开**企业微信 APP**,点击底部导航**工作台**
12
- 2. 进入**智能机器人**,点击右上角【**创建机器人**】
13
- 3. 点击底部【**手动创建**】
14
- 4. 滚动到最底部,点击【**API 模式创建**】
15
- 5. 填写机器人**名称**,选择**可见范围**
16
- 6. **连接方式**选择**使用长连接**
17
- 7. 复制配置信息中的 **Bot ID** 和 **Secret**
18
- 8. 根据需要调整**可使用权限**中的授权范围
19
- 9. 点击**保存**
20
-
21
- 完成后,请将 **Bot ID** 和 **Secret** 粘贴给我。
22
-
23
- **等待用户提供 Bot ID 和 Secret,收到后继续执行 Step 5。**
24
-
25
- ---
26
-
27
- ## Step 5:安装插件,写入企业微信凭据,重启网关
28
-
29
- 首先执行插件安装(注意需要安装指定2.4.0版本):
30
-
31
- ```bash
32
- openclaw plugins install @sunnoy/wecom@2.4.0
33
- ```
34
-
35
- 安装完成后,使用 Read + Edit/Write 工具修改 `~/.openclaw/openclaw.json`,填写 `channels.wecom`:
36
-
37
- ```json
38
- "channels": {
39
- "wecom": {
40
- "enabled": true,
41
- "botId": "<BOT_ID>",
42
- "secret": "<SECRET>",
43
- "allowFrom": [],
44
- "dmPolicy": "pairing"
45
- }
46
- }
47
- ```
48
-
49
- 写入完成后重启网关:
50
-
51
- ```bash
52
- openclaw gateway restart
53
- ```
54
-
55
- ---
56
-
57
- ## Step 6:提示用户将机器人加入群聊
58
-
59
- 将下列步骤提示给用户:
60
-
61
- 1. 打开**企业微信 APP**,进入目标群聊
62
- 2. 点击右上角「**...**」→「**群机器人**」→「**添加机器人**」
63
- 3. 搜索刚创建的机器人名称并添加
64
- 4. @机器人发送消息即可使用