@sourcegraph/amp 0.0.1764147773-g072411 → 0.0.1764148488-g9863c7
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.
- package/dist/main.js +11 -11
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -4139,11 +4139,11 @@ Actual: ${G}`)}async function VZ8(J,Q,Y){let{execSync:X}=await import("node:ch
|
|
|
4139
4139
|
${N}`;if(G==="pnpm"&&N.includes("Unable to find the global bin directory"))M+=`
|
|
4140
4140
|
|
|
4141
4141
|
Hint: Try running "pnpm setup" to configure pnpm global directory, or use npm instead:
|
|
4142
|
-
npm install -g @sourcegraph/amp`;V(Error(M))}},error:(U)=>{if(!H)H=!0,V(Error(`Failed to spawn ${G}: ${U.message}`))},complete:()=>{if(!H)H=!0,q()}})})}L0();L0();async function _61(J,Q){let X=Q||"https://registry.npmjs.org";try{let G=new AbortController,Z=setTimeout(()=>G.abort(),5000),q=await fetch(`${X}/@sourcegraph/amp`,{signal:G.signal});if(clearTimeout(Z),!q.ok)return{hasUpdate:!1,currentVersion:J,source:"npm"};let V=await q.json(),K=V["dist-tags"]?.latest;if(!K)return{hasUpdate:!1,currentVersion:J,source:"npm"};let W=FZ8(J,K),H=W<0,z,U;if(V.time){let N=V.time[J],M=V.time[K],L=Date.now();if(N)z=Math.floor((L-new Date(N).getTime())/3600000);if(M)U=Math.floor((L-new Date(M).getTime())/3600000)}return f.info("NPM version comparison",{currentVersion:J,latestVersion:K,compareResult:W,hasUpdate:H,currentVersionAge:z,latestVersionAge:U}),{hasUpdate:H,latestVersion:K,currentVersion:J,currentVersionAge:z,latestVersionAge:U,source:"npm"}}catch(G){return f.debug("Error checking npm version",{error:G}),{hasUpdate:!1,currentVersion:J,source:"npm"}}}function FZ8(J,Q){let Y=(q)=>{let[V,K]=q.split("-");return{parts:V?.split(".").map(Number)||[],label:K}},X=Y(J),G=Y(Q),Z=Math.max(X.parts.length,G.parts.length);for(let q=0;q<Z;q++){let V=X.parts[q]||0,K=G.parts[q]||0;if(V<K)return-1;if(V>K)return 1}if(X.label===G.label)return 0;if(!X.label&&G.label)return 1;if(X.label&&!G.label)return-1;if(X.label&&G.label)return X.label<G.label?-1:1;return 0}o0();function k61(J,Q){let Y=new y4,X=Y.pipe(r8({shouldCountRefs:!1}));return setImmediate(async()=>{let G=new LV().scoped("update"),Z=X.subscribe({next:(q)=>{G.debug("emit new state",q)}});try{let q=process.env.AMP_TEST_UPDATE_STATUS;if(q){G.debug("using fake update status for testing",{status:q}),await jU(500),Y.next(q);return}if(process.env.AMP_SKIP_UPDATE_CHECK==="1"){G.debug("checking disabled via AMP_SKIP_UPDATE_CHECK environment variable");return}let V=await Q.get("updates.mode");if(V==="disabled"){G.debug("checking disabled");return}G.debug("checking",{currentVersion:J,mode:V});let K=dA(),W=await _61(J,K);if(!(W.latestVersion&&W.hasUpdate)){G.debug("no update available");return}let H=()=>{if(W.currentVersionAge!==void 0&&W.latestVersionAge!==void 0){let U=W.currentVersionAge-W.latestVersionAge,N=0.5;if(Math.abs(U)<0.5)return G.debug("versions too close together, suppressing update warning",{currentVersionAge:W.currentVersionAge,latestVersionAge:W.latestVersionAge,ageDifferenceHours:U}),!0}return!1},z=await S61();if(!V)V=z==="pnpm"?"warn":"auto",G.debug("no configured update mode; selected default based on package manager",{packageManager:z,mode:V});if(V==="warn"){if(!H())Y.next("update-available");return}if(!z){if(G.debug("auto-update not supported, falling back to warn mode"),!H())Y.next("update-available");return}try{await Cg(W.latestVersion,z);let U=await lB(W.latestVersion),N={from:W.currentVersion,to:W.latestVersion,...U};if(U.status==="same")G.info("success",N),Y.next("updated");else G.warn("success with warning",N),Y.next("updated-with-warning")}catch(U){Y.next("update-error")}}catch(q){G.debug("check failed",{error:q})}finally{await jU(5000),Y.next("hidden"),Z.unsubscribe(),Y.complete()}}),{state:X}}import{stderr as RK}from"node:process";function g86(J){let Q=new jA().name("install").description("Install required tools like ripgrep to $AMP_HOME/bin").option("--force","Force reinstallation even if already installed").option("--verbose","Show installation progress and results").action(async(X)=>{await CR1(X.force||!1,X.verbose||!1,"0.0.
|
|
4142
|
+
npm install -g @sourcegraph/amp`;V(Error(M))}},error:(U)=>{if(!H)H=!0,V(Error(`Failed to spawn ${G}: ${U.message}`))},complete:()=>{if(!H)H=!0,q()}})})}L0();L0();async function _61(J,Q){let X=Q||"https://registry.npmjs.org";try{let G=new AbortController,Z=setTimeout(()=>G.abort(),5000),q=await fetch(`${X}/@sourcegraph/amp`,{signal:G.signal});if(clearTimeout(Z),!q.ok)return{hasUpdate:!1,currentVersion:J,source:"npm"};let V=await q.json(),K=V["dist-tags"]?.latest;if(!K)return{hasUpdate:!1,currentVersion:J,source:"npm"};let W=FZ8(J,K),H=W<0,z,U;if(V.time){let N=V.time[J],M=V.time[K],L=Date.now();if(N)z=Math.floor((L-new Date(N).getTime())/3600000);if(M)U=Math.floor((L-new Date(M).getTime())/3600000)}return f.info("NPM version comparison",{currentVersion:J,latestVersion:K,compareResult:W,hasUpdate:H,currentVersionAge:z,latestVersionAge:U}),{hasUpdate:H,latestVersion:K,currentVersion:J,currentVersionAge:z,latestVersionAge:U,source:"npm"}}catch(G){return f.debug("Error checking npm version",{error:G}),{hasUpdate:!1,currentVersion:J,source:"npm"}}}function FZ8(J,Q){let Y=(q)=>{let[V,K]=q.split("-");return{parts:V?.split(".").map(Number)||[],label:K}},X=Y(J),G=Y(Q),Z=Math.max(X.parts.length,G.parts.length);for(let q=0;q<Z;q++){let V=X.parts[q]||0,K=G.parts[q]||0;if(V<K)return-1;if(V>K)return 1}if(X.label===G.label)return 0;if(!X.label&&G.label)return 1;if(X.label&&!G.label)return-1;if(X.label&&G.label)return X.label<G.label?-1:1;return 0}o0();function k61(J,Q){let Y=new y4,X=Y.pipe(r8({shouldCountRefs:!1}));return setImmediate(async()=>{let G=new LV().scoped("update"),Z=X.subscribe({next:(q)=>{G.debug("emit new state",q)}});try{let q=process.env.AMP_TEST_UPDATE_STATUS;if(q){G.debug("using fake update status for testing",{status:q}),await jU(500),Y.next(q);return}if(process.env.AMP_SKIP_UPDATE_CHECK==="1"){G.debug("checking disabled via AMP_SKIP_UPDATE_CHECK environment variable");return}let V=await Q.get("updates.mode");if(V==="disabled"){G.debug("checking disabled");return}G.debug("checking",{currentVersion:J,mode:V});let K=dA(),W=await _61(J,K);if(!(W.latestVersion&&W.hasUpdate)){G.debug("no update available");return}let H=()=>{if(W.currentVersionAge!==void 0&&W.latestVersionAge!==void 0){let U=W.currentVersionAge-W.latestVersionAge,N=0.5;if(Math.abs(U)<0.5)return G.debug("versions too close together, suppressing update warning",{currentVersionAge:W.currentVersionAge,latestVersionAge:W.latestVersionAge,ageDifferenceHours:U}),!0}return!1},z=await S61();if(!V)V=z==="pnpm"?"warn":"auto",G.debug("no configured update mode; selected default based on package manager",{packageManager:z,mode:V});if(V==="warn"){if(!H())Y.next("update-available");return}if(!z){if(G.debug("auto-update not supported, falling back to warn mode"),!H())Y.next("update-available");return}try{await Cg(W.latestVersion,z);let U=await lB(W.latestVersion),N={from:W.currentVersion,to:W.latestVersion,...U};if(U.status==="same")G.info("success",N),Y.next("updated");else G.warn("success with warning",N),Y.next("updated-with-warning")}catch(U){Y.next("update-error")}}catch(q){G.debug("check failed",{error:q})}finally{await jU(5000),Y.next("hidden"),Z.unsubscribe(),Y.complete()}}),{state:X}}import{stderr as RK}from"node:process";function g86(J){let Q=new jA().name("install").description("Install required tools like ripgrep to $AMP_HOME/bin").option("--force","Force reinstallation even if already installed").option("--verbose","Show installation progress and results").action(async(X)=>{await CR1(X.force||!1,X.verbose||!1,"0.0.1764148488-g9863c7"),process.exit()});J.addCommand(Q,{hidden:!0});let Y=new jA("update").summary("Update Amp CLI").description("Update Amp CLI to the latest version. You can specify a particular version to install, or leave blank to get the latest stable release.").option("--target-version <version>","Update to a specific version").allowUnknownOption(!1).action(async(X)=>{await UZ8(X.targetVersion)});J.addCommand(Y)}async function UZ8(J){if(process.env.AMP_SKIP_UPDATE_CHECK==="1")RK.write(h4.yellow(`Note: AMP_SKIP_UPDATE_CHECK=1 is set, which disables automatic update checking. Manual updates will still work.
|
|
4143
4143
|
|
|
4144
4144
|
`));try{if(!J){RK.write(h4.blue(`Checking for updates...
|
|
4145
|
-
`));let Y=dA(),{hasUpdate:X,latestVersion:G}=await _61("0.0.
|
|
4146
|
-
`));let Z=await lB("0.0.
|
|
4145
|
+
`));let Y=dA(),{hasUpdate:X,latestVersion:G}=await _61("0.0.1764148488-g9863c7",Y);if(!X){RK.write(h4.green(`✓ Amp CLI is already up to date.
|
|
4146
|
+
`));let Z=await lB("0.0.1764148488-g9863c7");if(Z.warning)RK.write(`
|
|
4147
4147
|
`+h4.yellow(Z.warning)+`
|
|
4148
4148
|
`);process.exit(0)}if(!G)RK.write(h4.yellow("[WARN] could not find latest version")),process.exit(0);J=G}RK.write(h4.blue(`Updating to version ${J}...
|
|
4149
4149
|
`)),await Cg(J,void 0,(Y)=>{RK.write(h4.dim(`Running: ${Y}
|
|
@@ -4367,7 +4367,7 @@ Visit https://ampcode.com/settings to set up GitHub integration.`);throw new S8(
|
|
|
4367
4367
|
`;return;case 13:this.pasteBuffer+="\r";return;case 9:this.pasteBuffer+="\t";return;default:return}if(J.code===10){let Y={type:"key",key:"Enter",shiftKey:!0,ctrlKey:!1,altKey:!1,metaKey:!1};this.emitKeyEvent(Y);return}let Q=this.controlCharacterToGrapheme(J.code);if(Q){let Y={type:"key",key:Q,shiftKey:!1,ctrlKey:this.isControlCharacter(J.code)&&J.code!==127&&J.code!==8&&J.code!==9&&J.code!==10&&J.code!==13&&J.code!==27,altKey:!1,metaKey:!1};this.emitKeyEvent(Y)}}controlCharacterToGrapheme(J){switch(J){case 8:return"Backspace";case 9:return"Tab";case 10:return"Enter";case 13:return"Enter";case 27:return"Escape";case 127:return"Backspace";case 0:return"@";case 1:return"a";case 2:return"b";case 3:return"c";case 4:return"d";case 5:return"e";case 6:return"f";case 7:return"g";case 11:return"k";case 12:return"l";case 14:return"n";case 15:return"o";case 16:return"p";case 17:return"q";case 18:return"r";case 19:return"s";case 20:return"t";case 21:return"u";case 22:return"v";case 23:return"w";case 24:return"x";case 25:return"y";case 26:return"z";default:return null}}isControlCharacter(J){return J>=0&&J<=26||J===27||J===127}handleEscapeEvent(J){this.clearEscapeTimeout();let Q=this.escapeToKey(J);if(Q)this.emitKeyEvent(Q)}handleDcsEvent(J){for(let Q of this.dcsHandlers)Q(J)}handleOscEvent(J){for(let Q of this.oscHandlers)Q(J)}handleApcEvent(J){for(let Q of this.apcHandlers)Q(J)}handleCsiEvent(J){if(this.clearEscapeTimeout(),this.handleBracketedPaste(J))return;let Q=this.csiToFocus(J);if(Q){this.emitFocusEvent(Q);return}let Y=this.csiToCursorPositionReport(J);if(Y){this.emitCursorPositionReportEvent(Y);return}let X=this.csiToDeviceAttributes(J);if(X){this.emitDeviceAttributesEvent(X);return}let G=this.csiToDecrqss(J);if(G){this.emitDecrqssEvent(G);return}let Z=this.csiToKittyKeyboardResponse(J);if(Z){this.emitDecrqssEvent(Z);return}let q=this.csiToInBandResize(J);if(q){this.emitResizeEvent(q);return}if(J.final==="n"&&J.private==="?"&&J.params[0]?.value===997){let W=J.params[1]?.value??0;f.info("Received color palette change notification (mode 2031)",{mode:W}),this.emitColorPaletteChangeEvent({type:"colorPaletteChange",colorIndex:-1,value:""});return}let V=this.csiToSgrMouse(J);if(V){this.emitSgrMouseEvent(V);let W=this.sgrToMouseConverter(V);this.emitMouseEvent(W);return}let K=this.csiToKey(J);if(K)this.emitKeyEvent(K)}escapeToKey(J){if(J.intermediates==="O"){if(J.final==="P")return this.createKeyEvent("F1");if(J.final==="Q")return this.createKeyEvent("F2");if(J.final==="R")return this.createKeyEvent("F3");if(J.final==="S")return this.createKeyEvent("F4")}if(J.intermediates===""&&J.final.length===1){let Q=J.final.charCodeAt(0);if(Q>=32&&Q<=126)return{type:"key",key:J.final,shiftKey:this.isShifted(J.final),ctrlKey:!1,altKey:!0,metaKey:!1};else if(Q==127)return{type:"key",key:"Backspace",shiftKey:!1,ctrlKey:!1,altKey:!0,metaKey:!1}}return null}csiToKey(J){let{final:Q,params:Y}=J;if(Y.length===0||Y.length===1&&Y[0]?.value===0)Y=[{value:1}];let X=null,G={shift:!1,ctrl:!1,alt:!1,meta:!1},Z=1,q="";if(Y.length>=1){let V=Y[0]?.value??1;if(V===1&&Q==="Z")X="Tab",G.shift=!0;else X=this.getSpecialKey(V,Q)??this.unicodeToKey(V)}if(Y.length>=2){let V=Y[1]?.value??1;G=this.parseModifiers(V)}if(Y.length>=3){let V=Y[2]?.value??1;if(Q==="u")Z=V-1;else if(Q==="~"&&Y[0]?.value===27)X=this.unicodeToKey(V)}if(Z!==1&&Z!==0)return null;if(!X)return null;if(q===""&&G.shift&&!G.ctrl&&!G.alt&&!G.meta){let V=this.keyToUnicode(X);if(V&&V>=32&&V<=126)q=X.toUpperCase()}return this.createKeyEventWithModifiers(X,G,q)}parseModifiers(J){if(J===0||J===1)return{shift:!1,ctrl:!1,alt:!1,meta:!1};let Q=J-1;return{shift:(Q&1)!==0,alt:(Q&2)!==0,ctrl:(Q&4)!==0,meta:(Q&8)!==0}}unicodeToKey(J){if(J===13)return"Enter";if(J===9)return"Tab";if(J===27)return"Escape";if(J===127)return"Backspace";if(J===32)return" ";if(J>=1&&J<=26)return String.fromCharCode(J+96);if(M96[J])return M96[J];if(J>=32&&J<=126)return String.fromCharCode(J);if(J>126)try{return String.fromCharCode(J)}catch{return null}return null}createKeyEvent(J){return{type:"key",key:J,shiftKey:!1,ctrlKey:!1,altKey:!1,metaKey:!1}}createKeyEventWithModifiers(J,Q,Y){return{type:"key",key:J,shiftKey:Q.shift,ctrlKey:Q.ctrl,altKey:Q.alt,metaKey:Q.meta}}static SPECIAL_KEYS=new Map([["1:A","ArrowUp"],["1:B","ArrowDown"],["1:C","ArrowRight"],["1:D","ArrowLeft"],["1:H","Home"],["1:F","End"],["1:P","F1"],["1:Q","F2"],["1:R","F3"],["1:S","F4"],["1:~","Home"],["2:~","Insert"],["3:~","Delete"],["4:~","End"],["5:~","PageUp"],["6:~","PageDown"],["7:~","Home"],["8:~","End"],["9:~","Tab"],["11:~","F1"],["12:~","F2"],["13:~","F3"],["14:~","F4"],["15:~","F5"],["17:~","F6"],["18:~","F7"],["19:~","F8"],["20:~","F9"],["21:~","F10"],["23:~","F11"],["24:~","F12"]]);getSpecialKey(J,Q){let Y=`${J}:${Q}`;return kg.SPECIAL_KEYS.get(Y)||null}keyToUnicode(J){if(J.length===1)return J.charCodeAt(0);switch(J){case"Enter":return 13;case"Tab":return 9;case"Escape":return 27;case"Backspace":return 127;case" ":return 32}return null}isShifted(J){return J!==J.toLowerCase()}emitKeyEvent(J){for(let Q of this.keyHandlers)Q(J)}csiToDeviceAttributes(J){if(J.final==="c"&&J.private==="?"){let Q=0,Y=[];if(J.params.length>0){Q=J.params[0]?.value||0;let X=J.params.slice(1);if(X.length>0&&X[X.length-1]?.value===0)X=X.slice(0,-1);Y=X.map((G)=>G.value)}return{type:"device_attributes_primary",primary:Q,secondary:Y}}return null}csiToDecrqss(J){if(J.final==="y"&&J.intermediates.includes("$")){if(J.params.length>=2){let Q=`?${J.params[0]?.value||0}`,Y=String(J.params[1]?.value||0);return{type:"decrqss_response",request:Q,response:Y}}}return null}csiToKittyKeyboardResponse(J){if(J.final==="u"&&J.private==="?"){if(J.params.length>=1)return{type:"decrqss_response",request:"u",response:(J.params[0]?.value||0)>0?"1":"0"}}return null}emitDeviceAttributesEvent(J){for(let Q of this.deviceAttributesHandlers)Q(J)}csiToSgrMouse(J){if((J.final==="M"||J.final==="m")&&J.private==="<"){if(J.params.length>=3){let Q=J.params[0]?.value||0,Y=J.params[1]?.value||1,X=J.params[2]?.value||1,G=Q&-61,Z=J.final==="M"&&G!==3;return{type:"sgr_mouse",button:Q,x:Y,y:X,pressed:Z}}}return null}emitDecrqssEvent(J){for(let Q of this.decrqssHandlers)Q(J)}emitSgrMouseEvent(J){for(let Q of this.sgrMouseHandlers)Q(J)}emitMouseEvent(J){for(let Q of this.mouseHandlers)Q(J)}csiToFocus(J){if(J.intermediates===""&&(J.final==="I"||J.final==="O"))return{type:"focus",focused:J.final==="I"};return null}csiToInBandResize(J){if(J.final==="t"&&J.params.length>=5&&J.params[0]?.value===48){let Q=J.params[1]?.value||0,Y=J.params[2]?.value||0,X=J.params[3]?.value||0,G=J.params[4]?.value||0;return{type:"resize",width:Y,height:Q,pixelWidth:G,pixelHeight:X}}return null}csiToCursorPositionReport(J){if(J.final==="R"&&J.params.length===2){let Q=J.params[0]?.value||0,Y=J.params[1]?.value||0;return{type:"cursor_position_report",row:Q,col:Y}}return null}emitFocusEvent(J){for(let Q of this.focusHandlers)Q(J)}emitColorPaletteChangeEvent(J){for(let Q of this.colorPaletteChangeHandlers)Q({...J,type:"colorPaletteChange"})}emitCursorPositionReportEvent(J){for(let Q of this.cursorPositionReportHandlers)Q(J)}emitResizeEvent(J){for(let Q of this.resizeHandlers)Q(J)}handleBracketedPaste(J){if(J.final==="~"&&J.params.length===1){let Q=J.params[0]?.value;if(Q===200)return this.inPaste=!0,this.pasteBuffer="",!0;else if(Q===201){if(this.inPaste)this.inPaste=!1,this.emitPasteEvent({type:"paste",text:this.pasteBuffer}),this.pasteBuffer="";return!0}}return!1}emitPasteEvent(J){for(let Q of this.pasteHandlers)Q(J)}}function M$8(J){return J.replace(/\r\n|\r/g,`
|
|
4368
4368
|
`)}function L$8(J){return J.replace(/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\u007F-\u009F]/g,"")}function L96(J){let Q=J;return Q=M$8(Q),Q=L$8(Q),Q}L0();class oX{static instance=null;logs=[];maxLogs=1000;listeners=new Set;constructor(){}static getInstance(){if(!oX.instance)oX.instance=new oX;return oX.instance}addLog(J,Q,...Y){let X={timestamp:new Date,level:J,message:Q,args:Y};if(this.logs.push(X),this.logs.length>this.maxLogs)this.logs.shift();this.notifyListeners()}notifyListeners(){let J=this.getLogs();for(let Q of this.listeners)try{Q(J)}catch(Y){let X=this.originalConsole?.error;if(X)X("Error in log change listener:",Y)}}getLogs(){return[...this.logs]}clear(){this.logs=[],this.notifyListeners()}addListener(J){this.listeners.add(J)}removeListener(J){this.listeners.delete(J)}interceptConsole(){let J={error:console.error.bind(console),warn:console.warn.bind(console),info:console.info.bind(console),log:console.log.bind(console),debug:console.debug.bind(console)};console.error=(Q,...Y)=>{this.addLog("error",Q,...Y)},console.warn=(Q,...Y)=>{this.addLog("warn",Q,...Y)},console.info=(Q,...Y)=>{this.addLog("info",Q,...Y)},console.log=(Q,...Y)=>{this.addLog("info",Q,...Y)},console.debug=(Q,...Y)=>{this.addLog("debug",Q,...Y)},this.originalConsole=J}restoreConsole(){let J=this.originalConsole;if(J)console.error=J.error,console.warn=J.warn,console.info=J.info,console.log=J.log,console.debug=J.debug}}function A96(){try{if(oX.getInstance().restoreConsole(),process.stdout.write("\x1B[?1002l"),process.stdout.write("\x1B[?1003l"),process.stdout.write("\x1B[?1004l"),process.stdout.write("\x1B[?1006l"),process.stdout.write("\x1B[?1016l"),process.stdout.write("\x1B[?2004l"),process.stdout.write("\x1B[?2031l"),process.stdout.write("\x1B[?2048l"),process.stdout.write("\x1B[<u"),process.stdout.write("\x1B[?1049l"),process.stdout.write("\x1B[0 q"),process.stdout.write("\x1B[?25h"),process.stdout.write("\x1B[999;1H"),process.stdout.write("\x1B[0m"),!process.env.TERM_PROGRAM?.startsWith("iTerm"))process.stdout.write("\x1B]9;4;0\x1B\\")}catch(J){}}function L4(J,...Q){if(!J){let Y=Q.join(" "),X=Error(Y);f.error("TUI Assert failed",{assertion:Y,stackTrace:X.stack,meta:Q});let G=process.env.AMP_DEBUG,Z=process.env.VITEST;if(G||Z){if(Z)throw X;A96(),console.error("FATAL TUI ERROR:",Y),console.error("Stack trace:",X.stack),console.error("Context:",{meta:Q}),process.exit(1)}}}class uR1{parts=[];append(...J){this.parts.push(...J)}toString(){return this.parts.join("")}reset(){this.parts.length=0}get length(){return this.parts.length}get isEmpty(){return this.parts.length===0}}var $z="\x1B",G8="\x1B[",O96=G8+"0m",A$8=G8+"m",w96=(J,Q)=>G8+`${J+1};${Q+1}H`,O$8=G8+"H",w$8=G8+"?25l",E$8=G8+"?25h",I$8=G8+"2J",P$8=G8+"?2026h",T$8=G8+"?2026l",R$8=G8+"?2004h",C$8=G8+"?2004l",E96=[...Array.from({length:216},(J,Q)=>{let Y=Math.floor(Q/36),X=Math.floor(Q%36/6),G=Q%6,Z=(q)=>q===0?0:55+q*40;return[Z(Y),Z(X),Z(G)]}),...Array.from({length:24},(J,Q)=>{let Y=8+Q*10;return[Y,Y,Y]})],I96=new Map;function pR1(J,Q,Y){let X=`${J},${Q},${Y}`,G=I96.get(X);if(G!==void 0)return G;let Z=16,q=1/0;for(let V=0;V<E96.length;V++){let[K,W,H]=E96[V],z=(J-K)**2+(Q-W)**2+(Y-H)**2;if(z<q)q=z,Z=V+16}return I96.set(X,Z),Z}var j$8=G8+"?1049h",S$8=G8+"?1049l",_$8=G8+"?1002h"+G8+"?1003h"+G8+"?1004h"+G8+"?1006h",k$8=G8+"?1002l"+G8+"?1003l"+G8+"?1004l"+G8+"?1006l",y$8=G8+"?1016h",x$8=G8+"?1016l",v$8=G8+"?2027h",f$8=G8+"?2027l",h$8=G8+"?2048h",b$8=G8+"?2048l",g$8=G8+">1u",m$8=G8+"<u",u$8=(J)=>$z+`]22;${J}`+$z+"\\",p$8=(J)=>$z+`]0;${J}\x07`;function d$8(J){if(J==="\t")return!1;let Q=J.codePointAt(0);if(Q===void 0)return!1;if(Q>=0&&Q<=8||Q>=10&&Q<=31||Q===127)return!0;if(Q>=128&&Q<=159)return!0;if(Q===8232||Q===8233)return!0;if(Q===65279)return!0;return!1}function c$8(J){let Q=J.codePointAt(0);if(Q===void 0)return"�";if(Q>=0&&Q<=31)return String.fromCodePoint(9216+Q);if(Q===127)return"␡";return"�"}var l$8=$z+"]9;4;3"+$z+"\\",R96=$z+"]9;4;0"+$z+"\\",i$8=$z+"]9;4;4"+$z+"\\",n$8=(J)=>G8+`${J} q`;function a$8(J){return _$8+(J?y$8:"")}function o$8(){return k$8+x$8}function dR1(J){return p$8(J)}function C96(){return R96}function P96(J,Q,Y){if(!J)return"";switch(J.type){case"default":return G8+(Q?"39":"49")+"m";case"index":return G8+`${Q?"38":"48"};5;${J.value}m`;case"rgb":{if(Y&&!Y.canRgb){let{r:V,g:K,b:W}=J.value,H=pR1(V,K,W);return G8+`${Q?"38":"48"};5;${H}m`}let X=Q?"38":"48",{r:G,g:Z,b:q}=J.value;return G8+`${X};2;${G};${Z};${q}m`}default:return""}}function r$8(J,Q,Y){let X="";if(J.fg!==Q.fg){if(J.fg===void 0&&Q.fg!==void 0)X+=G8+"39m";else X+=P96(J.fg,!0,Y);Q.fg=J.fg}if(J.bg!==Q.bg){if(J.bg===void 0&&Q.bg!==void 0)X+=G8+"49m";else X+=P96(J.bg,!1,Y);Q.bg=J.bg}if(J.bold!==Q.bold){if(X+=J.bold?G8+"1m":G8+"22m",Q.bold=J.bold,!J.bold&&J.dim)X+=G8+"2m"}if(J.italic!==Q.italic)X+=J.italic?G8+"3m":G8+"23m",Q.italic=J.italic;if(J.underline!==Q.underline){if(Y?.underlineSupport!=="none")X+=J.underline?G8+"4m":G8+"24m";Q.underline=J.underline}if(J.strikethrough!==Q.strikethrough)X+=J.strikethrough?G8+"9m":G8+"29m",Q.strikethrough=J.strikethrough;if(J.reverse!==Q.reverse)X+=J.reverse?G8+"7m":G8+"27m",Q.reverse=J.reverse;if(J.dim!==Q.dim){if(X+=J.dim?G8+"2m":G8+"22m",Q.dim=J.dim,!J.dim&&J.bold)X+=G8+"1m"}return X}function s$8(J,Q){let Y="";if(!d61(J,Q.hyperlink)){if(Q.hyperlink)Y+=c61();if(J)Y+=U96(J);Q.hyperlink=J}return Y}function T96(J,Q){if(J===Q)return!0;if(J===void 0||Q===void 0)return!1;if(J.type!==Q.type)return!1;switch(J.type){case"default":return!0;case"index":return Q.value===J.value;case"rgb":{let Y=Q.value;return Y.r===J.value.r&&Y.g===J.value.g&&Y.b===J.value.b}default:return!1}}function t$8(J,Q){return T96(J.fg,Q.fg)&&T96(J.bg,Q.bg)&&J.bold===Q.bold&&J.italic===Q.italic&&J.underline===Q.underline&&J.strikethrough===Q.strikethrough&&J.reverse===Q.reverse&&J.dim===Q.dim}class cR1{capabilities;currentStyle={};currentX=0;currentY=0;constructor(J){this.capabilities=J}updateCapabilities(J){this.capabilities=J}render(J){if(J.length===0)return"";let Q=this.batchDiffs(J),Y=new uR1;for(let X of Q){if(this.currentX!==X.x||this.currentY!==X.y)Y.append(w96(X.y,X.x)),this.currentX=X.x,this.currentY=X.y;Y.append(r$8(X.style,this.currentStyle,this.capabilities)),Y.append(s$8(X.hyperlink,this.currentStyle)),Y.append(X.chars.join("")),this.currentX+=X.totalWidth}return Y.toString()}clearScreen(){return this.currentX=0,this.currentY=0,this.currentStyle={},O96+c61()+I$8+O$8}hideCursor(){return w$8}showCursor(){return E$8}setCursorShape(J){if(this.capabilities?.supportsCursorShape===!1)return"";return n$8(J)}reset(){return this.currentStyle={},O96+c61()}moveTo(J,Q){return this.currentX=J,this.currentY=Q,w96(Q,J)}batchDiffs(J){if(J.length===0)return[];let Q=[],Y=null,X=-1,G=-1;for(let Z of J){let q=d$8(Z.cell.char),V=Z.cell.char;if(q)Z.cell.char=c$8(Z.cell.char);if(L4(!q,`Cell contains disallowed control at (${Z.x}, ${Z.y}):`,`U+${V.codePointAt(0)?.toString(16).toUpperCase().padStart(4,"0")}`),Z.y!==X)X=Z.y,G=-1;if(G!==-1&&Z.x<G)continue;if(G=-1,Y&&Y.y===Z.y&&Y.x+Y.totalWidth===Z.x&&t$8(Y.style,Z.cell.style)&&d61(Y.hyperlink,Z.cell.hyperlink)){let W=Z.cell.char==="\t"?" ".repeat(_g):Z.cell.char;if(this.capabilities?.kittyExplicitWidth&&Z.cell.width>1&&Z.cell.char!=="\t")W=`\x1B]66;w=${Z.cell.width};${W}\x1B\\`;if(Y.chars.push(W),Y.totalWidth+=Z.cell.width,Z.cell.width>1)G=Z.x+Z.cell.width}else{let W=Z.cell.char==="\t"?" ".repeat(_g):Z.cell.char;if(this.capabilities?.kittyExplicitWidth&&Z.cell.width>1&&Z.cell.char!=="\t")W=`\x1B]66;w=${Z.cell.width};${W}\x1B\\`;if(Y={x:Z.x,y:Z.y,chars:[W],style:Z.cell.style,hyperlink:Z.cell.hyperlink,totalWidth:Z.cell.width},Q.push(Y),Z.cell.width>1)G=Z.x+Z.cell.width}}return Q}getCursorPosition(){return{x:this.currentX,y:this.currentY}}resetState(){this.currentStyle={},this.currentX=0,this.currentY=0}startSync(){return P$8}endSync(){return T$8}enterAltScreen(){return j$8+this.clearScreen()}exitAltScreen(){return S$8}resetCursor(){return A$8}enableMouse(J=!1){return a$8(J)}disableMouse(){return o$8()}enableEmojiWidth(){return v$8}disableEmojiWidth(){return f$8}enableInBandResize(){return h$8}disableInBandResize(){return b$8}enableBracketedPaste(){return R$8}disableBracketedPaste(){return C$8}enableKittyKeyboard(){return g$8}disableKittyKeyboard(){return m$8}setMouseShape(J){return u$8(J)}setProgressBarIndeterminate(){return l$8}setProgressBarOff(){return R96}setProgressBarPaused(){return i$8}}var nB=N6(j96(),1);(function(J){var Q="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",Y={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},X={bash:Y,environment:{pattern:RegExp("\\$"+Q),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+Q),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};J.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+Q),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:X},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:Y}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:X},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:X.entity}}],environment:{pattern:RegExp("\\$?"+Q),alias:"constant"},variable:X.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},Y.inside=J.languages.bash;var G=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],Z=X.variable[1].inside;for(var q=0;q<G.length;q++)Z[G[q]]=J.languages.bash[G[q]];J.languages.sh=J.languages.bash,J.languages.shell=J.languages.bash})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};(function(J){var Q=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,Y=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return Q.source});J.languages.cpp=J.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return Q.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:Q,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),J.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return Y})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),J.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:J.languages.cpp}}}}),J.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),J.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:J.languages.extend("cpp",{})}}),J.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},J.languages.cpp["base-clause"])})(Prism);(function(J){function Q(r,l){return r.replace(/<<(\d+)>>/g,function(F1,y1){return"(?:"+l[+y1]+")"})}function Y(r,l,F1){return RegExp(Q(r,l),F1||"")}function X(r,l){for(var F1=0;F1<l;F1++)r=r.replace(/<<self>>/g,function(){return"(?:"+r+")"});return r.replace(/<<self>>/g,"[^\\s\\S]")}var G={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function Z(r){return"\\b(?:"+r.trim().replace(/ /g,"|")+")\\b"}var q=Z(G.typeDeclaration),V=RegExp(Z(G.type+" "+G.typeDeclaration+" "+G.contextual+" "+G.other)),K=Z(G.typeDeclaration+" "+G.contextual+" "+G.other),W=Z(G.type+" "+G.typeDeclaration+" "+G.other),H=X(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),z=X(/\((?:[^()]|<<self>>)*\)/.source,2),U=/@?\b[A-Za-z_]\w*\b/.source,N=Q(/<<0>>(?:\s*<<1>>)?/.source,[U,H]),M=Q(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[K,N]),L=/\[\s*(?:,\s*)*\]/.source,A=Q(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[M,L]),E=Q(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[H,z,L]),P=Q(/\(<<0>>+(?:,<<0>>+)+\)/.source,[E]),I=Q(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[P,M,L]),R={keyword:V,punctuation:/[<>()?,.:[\]]/},S=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,y=/"(?:\\.|[^\\"\r\n])*"/.source,h=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;J.languages.csharp=J.languages.extend("clike",{string:[{pattern:Y(/(^|[^$\\])<<0>>/.source,[h]),lookbehind:!0,greedy:!0},{pattern:Y(/(^|[^@$\\])<<0>>/.source,[y]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:Y(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[M]),lookbehind:!0,inside:R},{pattern:Y(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[U,I]),lookbehind:!0,inside:R},{pattern:Y(/(\busing\s+)<<0>>(?=\s*=)/.source,[U]),lookbehind:!0},{pattern:Y(/(\b<<0>>\s+)<<1>>/.source,[q,N]),lookbehind:!0,inside:R},{pattern:Y(/(\bcatch\s*\(\s*)<<0>>/.source,[M]),lookbehind:!0,inside:R},{pattern:Y(/(\bwhere\s+)<<0>>/.source,[U]),lookbehind:!0},{pattern:Y(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[A]),lookbehind:!0,inside:R},{pattern:Y(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[I,W,U]),inside:R}],keyword:V,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),J.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),J.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:Y(/([(,]\s*)<<0>>(?=\s*:)/.source,[U]),lookbehind:!0,alias:"punctuation"}}),J.languages.insertBefore("csharp","class-name",{namespace:{pattern:Y(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[U]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:Y(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[z]),lookbehind:!0,alias:"class-name",inside:R},"return-type":{pattern:Y(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[I,M]),inside:R,alias:"class-name"},"constructor-invocation":{pattern:Y(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[I]),lookbehind:!0,inside:R,alias:"class-name"},"generic-method":{pattern:Y(/<<0>>\s*<<1>>(?=\s*\()/.source,[U,H]),inside:{function:Y(/^<<0>>/.source,[U]),generic:{pattern:RegExp(H),alias:"class-name",inside:R}}},"type-list":{pattern:Y(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[q,N,U,I,V.source,z,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:Y(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[N,z]),lookbehind:!0,greedy:!0,inside:J.languages.csharp},keyword:V,"class-name":{pattern:RegExp(I),greedy:!0,inside:R},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var u=y+"|"+S,p=Q(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[u]),g=X(Q(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[p]),2),i=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,Y1=Q(/<<0>>(?:\s*\(<<1>>*\))?/.source,[M,g]);J.languages.insertBefore("csharp","class-name",{attribute:{pattern:Y(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[i,Y1]),lookbehind:!0,greedy:!0,inside:{target:{pattern:Y(/^<<0>>(?=\s*:)/.source,[i]),alias:"keyword"},"attribute-arguments":{pattern:Y(/\(<<0>>*\)/.source,[g]),inside:J.languages.csharp},"class-name":{pattern:RegExp(M),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var a=/:[^}\r\n]+/.source,b=X(Q(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[p]),2),s=Q(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[b,a]),q1=X(Q(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[u]),2),K1=Q(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[q1,a]);function o(r,l){return{interpolation:{pattern:Y(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[r]),lookbehind:!0,inside:{"format-string":{pattern:Y(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[l,a]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:J.languages.csharp}}},string:/[\s\S]+/}}J.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:Y(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[s]),lookbehind:!0,greedy:!0,inside:o(s,b)},{pattern:Y(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[K1]),lookbehind:!0,greedy:!0,inside:o(K1,q1)}],char:{pattern:RegExp(S),greedy:!0}}),J.languages.dotnet=J.languages.cs=J.languages.csharp})(Prism);(function(J){var Q=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;J.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+Q.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+Q.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+Q.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+Q.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:Q,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},J.languages.css.atrule.inside.rest=J.languages.css;var Y=J.languages.markup;if(Y)Y.tag.addInlined("style","css"),Y.tag.addAttribute("style","css")})(Prism);(function(J){var Q=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],Y=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,X={pattern:RegExp(Y+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};J.languages.dart=J.languages.extend("clike",{"class-name":[X,{pattern:RegExp(Y+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:X.inside}],keyword:Q,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),J.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:J.languages.dart}}},string:/[\s\S]+/}},string:void 0}),J.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),J.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":X,keyword:Q,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);(function(J){var Q=/\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source,Y=/(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source.replace(/<SP_BS>/g,function(){return Q}),X=/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source,G=/--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(/<STR>/g,function(){return X}),Z={pattern:RegExp(X),greedy:!0},q={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function V(K,W){return K=K.replace(/<OPT>/g,function(){return G}).replace(/<SP>/g,function(){return Y}),RegExp(K,W)}J.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:V(/(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source,"i"),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[Z,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:V(/(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/.source,"i"),lookbehind:!0,greedy:!0},{pattern:V(/(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/.source,"i"),lookbehind:!0,greedy:!0},{pattern:V(/(^ONBUILD<SP>)\w+/.source,"i"),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:q,string:Z,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:q},J.languages.dockerfile=J.languages.docker})(Prism);Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/});Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];Prism.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:Prism.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/};Prism.hooks.add("after-tokenize",function(Q){if(Q.language!=="graphql")return;var Y=Q.tokens.filter(function(L){return typeof L!=="string"&&L.type!=="comment"&&L.type!=="scalar"}),X=0;function G(L){return Y[X+L]}function Z(L,A){A=A||0;for(var E=0;E<L.length;E++){var P=G(E+A);if(!P||P.type!==L[E])return!1}return!0}function q(L,A){var E=1;for(var P=X;P<Y.length;P++){var I=Y[P],R=I.content;if(I.type==="punctuation"&&typeof R==="string"){if(L.test(R))E++;else if(A.test(R)){if(E--,E===0)return P}}}return-1}function V(L,A){var E=L.alias;if(!E)L.alias=E=[];else if(!Array.isArray(E))L.alias=E=[E];E.push(A)}for(;X<Y.length;){var K=Y[X++];if(K.type==="keyword"&&K.content==="mutation"){var W=[];if(Z(["definition-mutation","punctuation"])&&G(1).content==="("){X+=2;var H=q(/^\($/,/^\)$/);if(H===-1)continue;for(;X<H;X++){var z=G(0);if(z.type==="variable")V(z,"variable-input"),W.push(z.content)}X=H+1}if(Z(["punctuation","property-query"])&&G(0).content==="{"){if(X++,V(G(0),"property-mutation"),W.length>0){var U=q(/^\{$/,/^\}$/);if(U===-1)continue;for(var N=X;N<U;N++){var M=Y[N];if(M.type==="variable"&&W.indexOf(M.content)>=0)V(M,"variable-input")}}}}}});(function(J){var Q=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,Y=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,X={pattern:RegExp(/(^|[^\w.])/.source+Y+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};J.languages.java=J.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[X,{pattern:RegExp(/(^|[^\w.])/.source+Y+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:X.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+Y+/[A-Z]\w*\b/.source),lookbehind:!0,inside:X.inside}],keyword:Q,function:[J.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),J.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),J.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":X,keyword:Q,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+Y+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:X.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+Y+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:X.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return Q.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism);Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});if(Prism.languages.markup)Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript");Prism.languages.js=Prism.languages.javascript;Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};Prism.languages.webmanifest=Prism.languages.json;(function(J){var Q=J.util.clone(J.languages.javascript),Y=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,X=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,G=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function Z(K,W){return K=K.replace(/<S>/g,function(){return Y}).replace(/<BRACES>/g,function(){return X}).replace(/<SPREAD>/g,function(){return G}),RegExp(K,W)}G=Z(G).source,J.languages.jsx=J.languages.extend("markup",Q),J.languages.jsx.tag.pattern=Z(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),J.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,J.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,J.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,J.languages.jsx.tag.inside.comment=Q.comment,J.languages.insertBefore("inside","attr-name",{spread:{pattern:Z(/<SPREAD>/.source),inside:J.languages.jsx}},J.languages.jsx.tag),J.languages.insertBefore("inside","special-attr",{script:{pattern:Z(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:J.languages.jsx}}},J.languages.jsx.tag);var q=function(K){if(!K)return"";if(typeof K==="string")return K;if(typeof K.content==="string")return K.content;return K.content.map(q).join("")},V=function(K){var W=[];for(var H=0;H<K.length;H++){var z=K[H],U=!1;if(typeof z!=="string")if(z.type==="tag"&&z.content[0]&&z.content[0].type==="tag")if(z.content[0].content[0].content==="</"){if(W.length>0&&W[W.length-1].tagName===q(z.content[0].content[1]))W.pop()}else if(z.content[z.content.length-1].content==="/>");else W.push({tagName:q(z.content[0].content[1]),openedBraces:0});else if(W.length>0&&z.type==="punctuation"&&z.content==="{")W[W.length-1].openedBraces++;else if(W.length>0&&W[W.length-1].openedBraces>0&&z.type==="punctuation"&&z.content==="}")W[W.length-1].openedBraces--;else U=!0;if(U||typeof z==="string"){if(W.length>0&&W[W.length-1].openedBraces===0){var N=q(z);if(H<K.length-1&&(typeof K[H+1]==="string"||K[H+1].type==="plain-text"))N+=q(K[H+1]),K.splice(H+1,1);if(H>0&&(typeof K[H-1]==="string"||K[H-1].type==="plain-text"))N=q(K[H-1])+N,K.splice(H-1,1),H--;K[H]=new J.Token("plain-text",N,null,N)}}if(z.content&&typeof z.content!=="string")V(z.content)}};J.hooks.add("after-tokenize",function(K){if(K.language!=="jsx"&&K.language!=="tsx")return;V(K.tokens)})})(Prism);(function(J){J.languages.kotlin=J.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete J.languages.kotlin["class-name"];var Q={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:J.languages.kotlin}};J.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:Q},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:Q},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete J.languages.kotlin.string,J.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),J.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),J.languages.kt=J.languages.kotlin,J.languages.kts=J.languages.kotlin})(Prism);Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/};(function(J){var Q=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function Y(H){return H=H.replace(/<inner>/g,function(){return Q}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+H+")")}var X=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,G=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return X}),Z=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;J.languages.markdown=J.languages.extend("markup",{}),J.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:J.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+G+Z+"(?:"+G+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+G+Z+")(?:"+G+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(X),inside:J.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+G+")"+Z+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+G+"$"),inside:{"table-header":{pattern:RegExp(X),alias:"important",inside:J.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:Y(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:Y(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:Y(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:Y(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(H){["url","bold","italic","strike","code-snippet"].forEach(function(z){if(H!==z)J.languages.markdown[H].inside.content.inside[z]=J.languages.markdown[z]})}),J.hooks.add("after-tokenize",function(H){if(H.language!=="markdown"&&H.language!=="md")return;function z(U){if(!U||typeof U==="string")return;for(var N=0,M=U.length;N<M;N++){var L=U[N];if(L.type!=="code"){z(L.content);continue}var A=L.content[1],E=L.content[3];if(A&&E&&A.type==="code-language"&&E.type==="code-block"&&typeof A.content==="string"){var P=A.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");P=(/[a-z][\w-]*/i.exec(P)||[""])[0].toLowerCase();var I="language-"+P;if(!E.alias)E.alias=[I];else if(typeof E.alias==="string")E.alias=[E.alias,I];else E.alias.push(I)}}}z(H.tokens)}),J.hooks.add("wrap",function(H){if(H.type!=="code-block")return;var z="";for(var U=0,N=H.classes.length;U<N;U++){var M=H.classes[U],L=/language-(.+)/.exec(M);if(L){z=L[1];break}}var A=J.languages[z];if(!A){if(z&&z!=="none"&&J.plugins.autoloader){var E="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*10000000000000000);H.attributes.id=E,J.plugins.autoloader.loadLanguages(z,function(){var P=document.getElementById(E);if(P)P.innerHTML=J.highlight(P.textContent,J.languages[z],z)})}}else H.content=J.highlight(W(H.content),A,z)});var q=RegExp(J.languages.markup.tag.pattern.source,"gi"),V={amp:"&",lt:"<",gt:">",quot:'"'},K=String.fromCodePoint||String.fromCharCode;function W(H){var z=H.replace(q,"");return z=z.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(U,N){if(N=N.toLowerCase(),N[0]==="#"){var M;if(N[1]==="x")M=parseInt(N.slice(2),16);else M=Number(N.slice(1));return K(M)}else{var L=V[N];if(L)return L;return U}}),z}J.languages.md=J.languages.markdown})(Prism);Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(J){if(J.type==="entity")J.attributes.title=J.content.replace(/&/,"&")});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(Q,Y){var X={};X["language-"+Y]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[Y]},X.cdata=/^<!\[CDATA\[|\]\]>$/i;var G={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:X}};G["language-"+Y]={pattern:/[\s\S]+/,inside:Prism.languages[Y]};var Z={};Z[Q]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return Q}),"i"),lookbehind:!0,greedy:!0,inside:G},Prism.languages.insertBefore("markup","cdata",Z)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(J,Q){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+J+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[Q,"language-"+Q],inside:Prism.languages[Q]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(J){var Q=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,Y=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],X=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,G=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,Z=/[{}\[\](),:;]/;J.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:Q,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:Y,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:X,operator:G,punctuation:Z};var q={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:J.languages.php},V=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:q}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:q}}];J.languages.insertBefore("php","variable",{string:V,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:Q,string:V,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:Y,number:X,operator:G,punctuation:Z}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),J.hooks.add("before-tokenize",function(K){if(!/<\?/.test(K.code))return;var W=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;J.languages["markup-templating"].buildPlaceholders(K,"php",W)}),J.hooks.add("after-tokenize",function(K){J.languages["markup-templating"].tokenizePlaceholders(K,"php")})})(Prism);(function(J){var Q=J.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};Q.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:Q},boolean:Q.boolean,variable:Q.variable}})(Prism);Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;Prism.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/};(function(J){J.languages.ruby=J.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),J.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var Q={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:J.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete J.languages.ruby.function;var Y="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",X=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;J.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+Y+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:Q,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:Q,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+X),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+X+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),J.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+Y),greedy:!0,inside:{interpolation:Q,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:Q,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:Q,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+Y),greedy:!0,inside:{interpolation:Q,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:Q,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete J.languages.ruby.string,J.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),J.languages.rb=J.languages.ruby})(Prism);(function(J){var Q=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source;for(var Y=0;Y<2;Y++)Q=Q.replace(/<self>/g,function(){return Q});Q=Q.replace(/<self>/g,function(){return/[^\s\S]/.source}),J.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+Q),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},J.languages.rust["closure-params"].inside.rest=J.languages.rust,J.languages.rust.attribute.inside.string=J.languages.rust.string})(Prism);Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}});Prism.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]});Prism.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/});Prism.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}});Prism.languages.scss.atrule.inside.rest=Prism.languages.scss;(function(J){var Q=[/"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/.source,/'[^']*'/.source,/\$'(?:[^'\\]|\\[\s\S])*'/.source,/<<-?\s*(["']?)(\w+)\1\s[\s\S]*?[\r\n]\2/.source].join("|");J.languages["shell-session"]={command:{pattern:RegExp(/^/.source+"(?:"+(/[^\s@:$#%*!/\\]+@[^\r\n@:$#%*!/\\]+(?::[^\0-\x1F$#%*?"<>:;|]+)?/.source+"|"+/[/~.][^\0-\x1F$#%*?"<>@:;|]*/.source)+")?"+/[$#%](?=\s)/.source+/(?:[^\\\r\n \t'"<$]|[ \t](?:(?!#)|#.*$)|\\(?:[^\r]|\r\n?)|\$(?!')|<(?!<)|<<str>>)+/.source.replace(/<<str>>/g,function(){return Q}),"m"),greedy:!0,inside:{info:{pattern:/^[^#$%]+/,alias:"punctuation",inside:{user:/^[^\s@:$#%*!/\\]+@[^\r\n@:$#%*!/\\]+/,punctuation:/:/,path:/[\s\S]+/}},bash:{pattern:/(^[$#%]\s*)\S[\s\S]*/,lookbehind:!0,alias:"language-bash",inside:J.languages.bash},"shell-symbol":{pattern:/^[$#%]/,alias:"important"}}},output:/.(?:.*(?:[\r\n]|.$))*/},J.languages["sh-session"]=J.languages.shellsession=J.languages["shell-session"]})(Prism);Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(J){J.inside.interpolation.inside=Prism.languages.swift});(function(J){var Q=/(?:[\w-]+|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*")/.source;function Y(X){return X.replace(/__/g,function(){return Q})}J.languages.toml={comment:{pattern:/#.*/,greedy:!0},table:{pattern:RegExp(Y(/(^[\t ]*\[\s*(?:\[\s*)?)__(?:\s*\.\s*__)*(?=\s*\])/.source),"m"),lookbehind:!0,greedy:!0,alias:"class-name"},key:{pattern:RegExp(Y(/(^[\t ]*|[{,]\s*)__(?:\s*\.\s*__)*(?=\s*=)/.source),"m"),lookbehind:!0,greedy:!0,alias:"property"},string:{pattern:/"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},date:[{pattern:/\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i,alias:"number"},{pattern:/\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/,alias:"number"}],number:/(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/,boolean:/\b(?:false|true)\b/,punctuation:/[.,=[\]{}]/}})(Prism);(function(J){var Q=J.util.clone(J.languages.typescript);J.languages.tsx=J.languages.extend("jsx",Q),delete J.languages.tsx.parameter,delete J.languages.tsx["literal-property"];var Y=J.languages.tsx.tag;Y.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+Y.pattern.source+")",Y.pattern.flags),Y.lookbehind=!0})(Prism);(function(J){J.languages.typescript=J.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),J.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete J.languages.typescript.parameter,delete J.languages.typescript["literal-property"];var Q=J.languages.extend("typescript",{});delete Q["class-name"],J.languages.typescript["class-name"].inside=Q,J.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:Q}}}}),J.languages.ts=J.languages.typescript})(Prism);(function(J){function Q(Z,q){if(J.languages[Z])J.languages.insertBefore(Z,"comment",{"doc-comment":q})}var Y=J.languages.markup.tag,X={pattern:/\/\/\/.*/,greedy:!0,alias:"comment",inside:{tag:Y}},G={pattern:/'''.*/,greedy:!0,alias:"comment",inside:{tag:Y}};Q("csharp",X),Q("fsharp",X),Q("vbnet",G)})(Prism);(function(J){var Q=/[*&][^\s[\]{},]+/,Y=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,X="(?:"+Y.source+"(?:[ \t]+"+Q.source+")?|"+Q.source+"(?:[ \t]+"+Y.source+")?)",G=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),Z=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function q(V,K){K=(K||"").replace(/m/g,"")+"m";var W=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return X}).replace(/<<value>>/g,function(){return V});return RegExp(W,K)}J.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return X})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return X}).replace(/<<key>>/g,function(){return"(?:"+G+"|"+Z+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:q(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:q(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:q(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:q(Z),lookbehind:!0,greedy:!0},number:{pattern:q(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:Y,important:Q,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},J.languages.yml=J.languages.yaml})(Prism);(function(J){function Q(K){return function(){return K}}var Y=/\b(?:align|allowzero|and|anyframe|anytype|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|nosuspend|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/,X="\\b(?!"+Y.source+")(?!\\d)\\w+\\b",G=/align\s*\((?:[^()]|\([^()]*\))*\)/.source,Z=/(?:\?|\bpromise->|(?:\[[^[\]]*\]|\*(?!\*)|\*\*)(?:\s*<ALIGN>|\s*const\b|\s*volatile\b|\s*allowzero\b)*)/.source.replace(/<ALIGN>/g,Q(G)),q=/(?:\bpromise\b|(?:\berror\.)?<ID>(?:\.<ID>)*(?!\s+<ID>))/.source.replace(/<ID>/g,Q(X)),V="(?!\\s)(?:!?\\s*(?:"+Z+"\\s*)*"+q+")+";J.languages.zig={comment:[{pattern:/\/\/[/!].*/,alias:"doc-comment"},/\/{2}.*/],string:[{pattern:/(^|[^\\@])c?"(?:[^"\\\r\n]|\\.)*"/,lookbehind:!0,greedy:!0},{pattern:/([\r\n])([ \t]+c?\\{2}).*(?:(?:\r\n?|\n)\2.*)*/,lookbehind:!0,greedy:!0}],char:{pattern:/(^|[^\\])'(?:[^'\\\r\n]|[\uD800-\uDFFF]{2}|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/,lookbehind:!0,greedy:!0},builtin:/\B@(?!\d)\w+(?=\s*\()/,label:{pattern:/(\b(?:break|continue)\s*:\s*)\w+\b|\b(?!\d)\w+\b(?=\s*:\s*(?:\{|while\b))/,lookbehind:!0},"class-name":[/\b(?!\d)\w+(?=\s*=\s*(?:(?:extern|packed)\s+)?(?:enum|struct|union)\s*[({])/,{pattern:RegExp(/(:\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?[=;,)])|<TYPE>(?=\s*(?:<ALIGN>\s*)?\{)/.source.replace(/<TYPE>/g,Q(V)).replace(/<ALIGN>/g,Q(G))),lookbehind:!0,inside:null},{pattern:RegExp(/(\)\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?;)/.source.replace(/<TYPE>/g,Q(V)).replace(/<ALIGN>/g,Q(G))),lookbehind:!0,inside:null}],"builtin-type":{pattern:/\b(?:anyerror|bool|c_u?(?:int|long|longlong|short)|c_longdouble|c_void|comptime_(?:float|int)|f(?:16|32|64|128)|[iu](?:8|16|32|64|128|size)|noreturn|type|void)\b/,alias:"keyword"},keyword:Y,function:/\b(?!\d)\w+(?=\s*\()/,number:/\b(?:0b[01]+|0o[0-7]+|0x[a-fA-F\d]+(?:\.[a-fA-F\d]*)?(?:[pP][+-]?[a-fA-F\d]+)?|\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)\b/,boolean:/\b(?:false|true)\b/,operator:/\.[*?]|\.{2,3}|[-=]>|\*\*|\+\+|\|\||(?:<<|>>|[-+*]%|[-+*/%^&|<>!=])=?|[?~]/,punctuation:/[.:,;(){}[\]]/},J.languages.zig["class-name"].forEach(function(K){if(K.inside===null)K.inside=J.languages.zig})})(Prism);function Jq8(J){let Q=J.split(".").pop()?.toLowerCase()||"";return{js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",javascript:"javascript",ts:"typescript",tsx:"typescript",typescript:"typescript",py:"python",pyw:"python",python:"python",java:"java",c:"c",h:"c",cc:"cpp",cpp:"cpp",cxx:"cpp","c++":"cpp",hpp:"cpp",hh:"cpp",hxx:"cpp",cs:"csharp",csharp:"csharp",go:"go",golang:"go",rs:"rust",rust:"rust",rb:"ruby",ruby:"ruby",php:"php",swift:"swift",kt:"kotlin",kts:"kotlin",kotlin:"kotlin",dart:"dart",sh:"bash",bash:"bash",zsh:"bash",shell:"bash",sql:"sql",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown",zig:"zig",pas:"pascal",pascal:"pascal",html:"markup",htm:"markup",xml:"markup",svg:"markup",markup:"markup",css:"css"}[Q]||"plain"}function Qq8(J,Q){switch(J.split(" ")[0]){case"keyword":case"important":case"atrule":return Q.keyword;case"string":case"char":case"regex":case"url":case"selector":case"attr-value":case"inserted":return Q.string;case"number":case"constant":case"boolean":case"symbol":return Q.number;case"comment":case"prolog":case"doctype":case"cdata":return Q.comment;case"function":case"class":return Q.function;case"variable":case"property":case"attr-name":case"class-name":return Q.variable;case"type":case"tag":return Q.type;case"operator":case"punctuation":case"delimiter":case"entity":case"builtin":case"deleted":return Q.operator;default:return Q.operator}}var lR1="unknown";function S96(J){lR1=J}function _96(J,Q,Y){if(lR1==="unknown")return null;let X=lR1==="light"?0.15:0.12,G=(Z)=>{if(Z.type==="rgb")return{...Z,alpha:X};if(Z.type==="index")return{...Z,alpha:X};return{type:"default",alpha:X}};return{added:G(J),removed:G(Q)}}function Yq8(J,Q,Y){let X=[];function G(Z,q){if(typeof Z==="string")X.push({content:Z,color:q});else{let V=q??Qq8(Z.type,Q);if(typeof Z.content==="string")X.push({content:Z.content,color:V});else if(Array.isArray(Z.content))Z.content.forEach((K)=>G(K,V));else G(Z.content,V)}}return J.forEach((Z)=>G(Z,Y)),X}function i61(J,Q,Y){try{let X=Y?Jq8(Y):"plain";if(X==="plain"||!nB.default.languages[X])return[{content:J}];let G=nB.default.tokenize(J,nB.default.languages[X]);return Yq8(G,Q)}catch(X){return[{content:J}]}}L0();import{openSync as Xq8}from"node:fs";import k96 from"node:tty";function Gq8(){let J=process.versions.bun;if(!J)return!1;let Q=J.split(".").map(Number),Y=Q[0]??0,X=Q[1]??0,G=Q[2]??0;if(!Number.isFinite(Y)||!Number.isFinite(X)||!Number.isFinite(G))return!1;if(Y!==1||X!==2)return!1;return G<22}function Zq8(){let J={stdin:null,dataCallback:null,init(){if(this.stdin!==null)return;let Q=Xq8("/dev/tty","r");if(!k96.isatty(Q))throw Error("/dev/tty is not a TTY device");let Y=new k96.ReadStream(Q);if(this.stdin=Y,Y.setRawMode(!0),this.dataCallback)Y.on("data",this.dataCallback)},on(Q,Y){if(this.dataCallback&&this.stdin)this.stdin.removeAllListeners("data");this.dataCallback=Y,this.stdin?.on(Q,Y)},pause(){if(this.stdin){if(this.stdin.setRawMode(!1),this.dataCallback)this.stdin.removeListener("data",this.dataCallback);this.stdin.destroy()}this.stdin=null},resume(){this.init()},dispose(){if(this.stdin){if(this.stdin.setRawMode(!1),this.dataCallback)this.stdin.removeListener("data",this.dataCallback);this.stdin.destroy()}this.stdin=null,this.dataCallback=null}};return J.init(),J}function y96(){let J={stdin:null,dataCallback:null,init(){if(this.stdin!==null)return;if(this.stdin=process.stdin,this.stdin.isTTY)this.stdin.setRawMode(!0);if(this.dataCallback)this.stdin.on("data",this.dataCallback)},on(Q,Y){if(this.dataCallback&&this.stdin)this.stdin.removeAllListeners("data");this.dataCallback=Y,this.stdin?.on(Q,Y)},pause(){if(this.stdin&&this.stdin.isTTY)this.stdin.setRawMode(!1);this.stdin?.pause()},resume(){if(this.stdin&&this.stdin.isTTY)this.stdin.setRawMode(!0);this.stdin?.resume()},dispose(){if(this.stdin&&this.stdin.isTTY)this.stdin.setRawMode(!1);if(this.stdin&&this.dataCallback)this.stdin.removeListener("data",this.dataCallback);this.stdin=null,this.dataCallback=null}};return J.init(),J}function x96(){if(process.platform==="win32")return y96();if(Gq8())return f.warn("Detected Bun <1.2.22 which has known /dev/tty issues. Please upgrade to Bun 1.2.22 or later for proper TTY support. Using process.stdin instead."),y96();return Zq8()}var $q8=50,qq8=200;class f96{eventBuffer=[];bufferTimer=null;filterDirection=null;lastEventTime=0;onEmitEvent=()=>{};constructor(J){this.onEmitEvent=J}handleWheelEvent(J){if(J.button!=="wheel_up"&&J.button!=="wheel_down")return!0;let Q=Date.now();if(this.filterDirection!==null)if(Q-this.lastEventTime>qq8)this.filterDirection=null;else return this.lastEventTime=Q,J.button===this.filterDirection;if(this.lastEventTime=Q,this.eventBuffer.push(J),!this.bufferTimer)this.bufferTimer=setTimeout(()=>{this.processBuffer()},$q8);return!1}processBuffer(){if(this.bufferTimer=null,this.eventBuffer.length===0)return;if(this.eventBuffer.some((Q)=>Q.button==="wheel_down")){this.filterDirection="wheel_down";for(let Q of this.eventBuffer)if(Q.button==="wheel_down")this.onEmitEvent(Q)}else{this.filterDirection="wheel_up";for(let Q of this.eventBuffer)this.onEmitEvent(Q)}this.eventBuffer=[]}}class iR1{parser=null;initialized=!1;inAltScreen=!1;suspended=!1;tty;screen;renderer;queryParser=null;capabilities=null;capabilityPromise=null;capabilityResolve=null;capabilityTimeout=null;terminalSize={width:80,height:24};jetBrainsWheelFilter;keyHandlers=[];mouseHandlers=[];resizeHandlers=[];focusHandlers=[];pasteHandlers=[];capabilityHandlers=[];boundHandleResize=this.handleResize.bind(this);boundCleanup=this.cleanup.bind(this);boundHandleResume=this.handleResume.bind(this);resizeDebounceTimer=null;pendingResize=!1;options={};constructor(){this.screen=new lA(80,24),this.renderer=new cR1,this.tty=x96(),this.jetBrainsWheelFilter=new f96((J)=>{for(let Q of this.mouseHandlers)Q(J)})}setOptions(J){this.options={...this.options,...J}}init(){if(this.initialized)throw Error("TUI is already initialized");try{this.parser=new kg,this.parser.onKey(this.handleKeyEvent.bind(this)),this.parser.onPaste(this.handlePasteEvent.bind(this)),this.parser.onOsc(this.handleOscEvent.bind(this)),this.queryParser=new g61(this.options.queryOptions),this.parser.onDeviceAttributes((J)=>{if(this.queryParser&&this.initialized){if(this.queryParser.processDeviceAttributes(J.primary,J.secondary))this.finishInitialization()}}),this.parser.onDecrqss((J)=>{if(this.queryParser&&this.initialized)this.queryParser.processDecrqss(J.request,J.response)}),this.parser.onDcs((J)=>{if(this.queryParser&&this.initialized){if(J.final==="|"&&J.private===">")this.queryParser.processXtversion(J.data);if(J.final==="r"&&J.intermediates==="+"&&J.params.length>0&&J.params[0]?.value===1)this.parseXtgettcapResponse(J.data)}}),this.parser.onApc((J)=>{if(this.queryParser&&this.initialized){if(J.data.startsWith("G"))this.queryParser.processKittyGraphics()}}),this.parser.onCursorPositionReport((J)=>{if(this.queryParser&&this.initialized)this.queryParser.processCursorPositionReport(J.row,J.col)}),this.parser.onColorPaletteChange((J)=>{if(this.queryParser&&this.initialized){f.info("Color palette change detected, re-querying colors");let Q=this.queryParser.getColorQuerySequences();for(let Y of Q)process.stdout.write(Y);this.queryParser.handleColorPaletteChangeNotification()}}),this.parser.onMouse((J)=>{if(c2()&&!this.jetBrainsWheelFilter.handleWheelEvent(J))return;for(let Q of this.mouseHandlers)Q(J)}),this.parser.onFocus((J)=>{for(let Q of this.focusHandlers)Q(J)}),this.parser.onResize((J)=>{this.handleInbandResize(J)}),this.tty.on("data",(J)=>{this.parser?.parse(J)}),this.tty.resume(),process.on("SIGWINCH",this.boundHandleResize),this.updateTerminalSize(),this.screen.resize(this.terminalSize.width,this.terminalSize.height),this.setupCleanupHandlers(),this.initialized=!0,this.enableMouse(),this.enableBracketedPaste(),this.createCapabilityPromise(),this.startCapabilityDetection()}catch(J){throw this.deinit(),J}}deinit(){if(this.initialized){let J="";if(J+=this.renderer.reset()+this.renderer.disableMouse()+this.renderer.disableEmojiWidth()+this.renderer.disableInBandResize()+this.renderer.disableBracketedPaste()+this.renderer.disableKittyKeyboard()+this.renderer.setCursorShape(0)+this.renderer.showCursor(),this.capabilities?.colorPaletteNotifications)J+="\x1B[?2031l";if(this.capabilities?.xtversion?.startsWith("ghostty"))J+=this.renderer.setProgressBarOff();if(this.inAltScreen)J+=this.renderer.exitAltScreen(),this.inAltScreen=!1;process.stdout.write(J)}if(this.resizeDebounceTimer)clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null;if(this.capabilityTimeout)clearTimeout(this.capabilityTimeout),this.capabilityTimeout=null;this.keyHandlers.length=0,this.mouseHandlers.length=0,this.resizeHandlers.length=0,this.focusHandlers.length=0,this.pasteHandlers.length=0,this.capabilityHandlers.length=0,process.removeListener("SIGWINCH",this.boundHandleResize),process.removeListener("SIGINT",this.boundCleanup),process.removeListener("SIGTERM",this.boundCleanup),process.removeListener("exit",this.boundCleanup),process.removeListener("SIGCONT",this.boundHandleResume),this.tty.dispose(),this.parser=null,this.queryParser=null,this.capabilities=null,this.capabilityPromise=null,this.capabilityResolve=null,this.initialized=!1}onKey(J){this.keyHandlers.push(J)}offKey(J){let Q=this.keyHandlers.indexOf(J);if(Q!==-1)this.keyHandlers.splice(Q,1)}onMouse(J){this.mouseHandlers.push(J)}offMouse(J){let Q=this.mouseHandlers.indexOf(J);if(Q!==-1)this.mouseHandlers.splice(Q,1)}onResize(J){this.resizeHandlers.push(J)}offResize(J){let Q=this.resizeHandlers.indexOf(J);if(Q!==-1)this.resizeHandlers.splice(Q,1)}onFocus(J){this.focusHandlers.push(J)}offFocus(J){let Q=this.focusHandlers.indexOf(J);if(Q!==-1)this.focusHandlers.splice(Q,1)}onPaste(J){this.pasteHandlers.push(J)}offPaste(J){let Q=this.pasteHandlers.indexOf(J);if(Q!==-1)this.pasteHandlers.splice(Q,1)}onCapabilities(J){this.capabilityHandlers.push(J)}offCapabilities(J){let Q=this.capabilityHandlers.indexOf(J);if(Q!==-1)this.capabilityHandlers.splice(Q,1)}isInitialized(){return this.initialized}getCapabilities(){return this.capabilities}getQueryParser(){return this.queryParser}async waitForCapabilities(J=1000){if(!this.initialized)throw Error("TUI is not initialized");if(this.capabilities)return this.capabilities;if(!this.capabilityPromise)throw Error("Capability detection not started");return this.capabilityPromise}getSize(){return{...this.terminalSize}}getScreen(){return this.screen}render(){if(!this.initialized)throw Error("TUI not initialized");if(this.suspended)return;let J=this.screen.getDiff(),Q=this.screen.getCursor();if(J.length>0||Q!==null){let X="";X+=this.renderer.startSync(),X+=this.renderer.hideCursor(),X+=this.renderer.reset(),X+=this.renderer.moveTo(0,0);let G=this.renderer.render(J);if(X+=G,Q&&this.screen.isCursorVisible())X+=this.renderer.moveTo(Q.x,Q.y),X+=this.renderer.setCursorShape(this.screen.getCursorShape()),X+=this.renderer.showCursor();else X+=this.renderer.hideCursor();X+=this.renderer.endSync(),process.stdout.write(X),this.screen.present()}}clearScreen(){let J=this.renderer.clearScreen()+this.renderer.hideCursor();process.stdout.write(J),this.renderer.resetState()}showCursor(){process.stdout.write(this.renderer.showCursor())}hideCursor(){process.stdout.write(this.renderer.hideCursor())}setCursor(J,Q){this.screen.setCursor(J,Q)}clearCursor(){this.screen.clearCursor()}setCursorShape(J){this.screen.setCursorShape(J)}setMouseCursor(J){let Q=`\x1B]22;${J}\x07`;process.stdout.write(Q)}resetMouseCursor(){this.setMouseCursor(l9.DEFAULT)}enableBracketedPaste(){process.stdout.write(this.renderer.enableBracketedPaste())}disableBracketedPaste(){process.stdout.write(this.renderer.disableBracketedPaste())}enableKittyKeyboard(){process.stdout.write(this.renderer.enableKittyKeyboard())}disableKittyKeyboard(){process.stdout.write(this.renderer.disableKittyKeyboard())}async writeClipboard(J){return Oq.writeText(J)}get clipboard(){return Oq}enterAltScreen(){if(!this.initialized)throw Error("TUI not initialized");if(!this.inAltScreen)process.stdout.write(this.renderer.enterAltScreen()),this.inAltScreen=!0}exitAltScreen(){if(this.inAltScreen)process.stdout.write(this.renderer.exitAltScreen()),this.inAltScreen=!1}isInAltScreen(){return this.inAltScreen}enableMouse(){if(this.initialized){let J=this.queryParser?.shouldUsePixelMouse()??!1,Q=this.renderer.enableMouse(J);process.stdout.write(Q)}}disableMouse(){if(this.initialized)process.stdout.write(this.renderer.disableMouse())}enableEmojiWidth(){if(this.initialized){let J=this.renderer.enableEmojiWidth();process.stdout.write(J)}}disableEmojiWidth(){if(this.initialized)process.stdout.write(this.renderer.disableEmojiWidth())}enableInBandResize(){if(this.initialized){let J=this.renderer.enableInBandResize();process.stdout.write(J)}}disableInBandResize(){if(this.initialized)process.stdout.write(this.renderer.disableInBandResize())}enableColorPaletteNotifications(){if(this.initialized)f.info("Enabling mode 2031 (color palette change notifications)"),process.stdout.write("\x1B[?2031h")}disableColorPaletteNotifications(){if(this.initialized)process.stdout.write("\x1B[?2031l")}setMouseShape(J){if(this.initialized)process.stdout.write(this.renderer.setMouseShape(J))}suspend(){if(!this.initialized||this.suspended)return;let J="";if(J+=this.renderer.reset()+this.renderer.disableMouse()+this.renderer.disableEmojiWidth()+this.renderer.disableInBandResize()+this.renderer.disableBracketedPaste()+this.renderer.disableKittyKeyboard()+this.renderer.setCursorShape(0)+this.renderer.showCursor(),this.capabilities?.colorPaletteNotifications)J+="\x1B[?2031l";if(this.capabilities?.xtversion?.startsWith("ghostty"))J+=this.renderer.setProgressBarOff();if(this.inAltScreen)J+=this.renderer.exitAltScreen(),this.inAltScreen=!1;if(process.stdout.write(J),this.tty.pause(),this.suspended=!0,process.stdout.isTTY)process.stdout.uncork()}resume(){if(!this.initialized||!this.suspended)return;if(this.tty.resume(),this.parser)this.parser.reset();if(this.enterAltScreen(),this.hideCursor(),this.enableMouse(),this.enableBracketedPaste(),this.capabilities?.emojiWidth)this.enableEmojiWidth();if(this.capabilities?.kittyKeyboard)this.enableKittyKeyboard();this.enableInBandResize(),this.screen.markForRefresh(),this.suspended=!1}isSuspended(){return this.suspended}handleSuspend(){if(!this.initialized||this.suspended)return;if(process.platform==="win32")return;this.suspend();try{process.kill(0,"SIGTSTP"),f.debug(`Successfully suspended process ${process.pid}`)}catch(J){f.debug(`Failed to suspend process ${process.pid}: ${J}`)}}handleResume(){if(!this.initialized||!this.suspended)return;this.resume(),setImmediate(()=>{if(this.initialized&&!this.suspended)this.render()})}updateTerminalSize(){if(!this.tty.stdin||!v96(this.tty.stdin)){this.terminalSize={width:80,height:24};return}try{if(process.stdout.isTTY&&process.stdout.columns&&process.stdout.rows){this.terminalSize={width:process.stdout.columns,height:process.stdout.rows};return}let J=process.stdout.getWindowSize();if(J[0]>0&&J[1]>0){this.terminalSize={width:J[0],height:J[1]};return}}catch(J){}}handleKeyEvent(J){for(let Q of this.keyHandlers)Q(J)}handlePasteEvent(J){let Q={type:"paste",text:L96(J.text)};for(let Y of this.pasteHandlers)Y(Q)}handleOscEvent(J){if(J.data.startsWith("10;")&&this.queryParser){this.queryParser.processOsc10(J.data);return}if(J.data.startsWith("11;")&&this.queryParser){this.queryParser.processOsc11(J.data);return}if(J.data.startsWith("12;")&&this.queryParser){this.queryParser.processOsc12(J.data);return}if(J.data.startsWith("4;")&&this.queryParser){this.queryParser.processOsc4(J.data);return}if(J.data.startsWith("52;c;")){let Q=J.data.slice(5);if(Q&&Q!=="?")Oq.handleOSC52Response(Q)}}createCapabilityPromise(){this.capabilityPromise=new Promise((J)=>{this.capabilityResolve=J})}startCapabilityDetection(){if(!this.tty.stdin||!v96(this.tty.stdin)){if(this.capabilityResolve)this.capabilityResolve(null);return}if(this.queryParser=new g61(this.options.queryOptions),process.env.TERM_PROGRAM==="Apple_Terminal"){let J=jg({canRgb:!1});this.capabilities=J;let Q={type:"capability",capabilities:this.capabilities};this.renderer.updateCapabilities(this.capabilities);for(let Y of this.capabilityHandlers)Y(Q);if(this.capabilityResolve)this.capabilityResolve(J),this.capabilityResolve=null;return}for(let J of K96){if(J.shouldSend&&!J.shouldSend())continue;if(process.stdout.write(J.sequence),J.description==="Query Kitty explicit width support")this.queryParser.markKittyWidthQuerySent()}this.capabilityTimeout=setTimeout(()=>{if(!this.capabilities&&this.capabilityResolve&&this.queryParser)this.finishInitialization()},2000)}finishInitialization(){if(!this.initialized||!this.queryParser||this.capabilities)return;if(this.capabilities=this.queryParser.getCapabilities(),this.capabilityTimeout)clearTimeout(this.capabilityTimeout),this.capabilityTimeout=null;let J={type:"capability",capabilities:this.capabilities};this.renderer.updateCapabilities(this.capabilities),S96(this.capabilities.background);for(let Q of this.capabilityHandlers)Q(J);if(this.capabilityResolve)f.info("Terminal capabilities detected:",this.capabilities),this.capabilityResolve(this.capabilities),this.capabilityResolve=null;if(this.queryParser.shouldUsePixelMouse()){let Q=this.queryParser.getPixelDimensions();if(Q){let Y=Q.pixelWidth/Q.columns,X=Q.pixelHeight/Q.rows;this.parser?.setSgrToMouseConverter((G)=>Sg(G,!0,Y,X))}}if(this.capabilities.emojiWidth)this.enableEmojiWidth();if(this.capabilities.kittyKeyboard)this.enableKittyKeyboard();if(this.enableInBandResize(),this.capabilities.colorPaletteNotifications)this.enableColorPaletteNotifications();Oq.setCapabilities(this.capabilities)}parseXtgettcapResponse(J){if(!this.queryParser)return;let Q=J.indexOf("=");if(Q!==-1){let Y=J.slice(0,Q),X=J.slice(Q+1);if(this.queryParser.processXtgettcap(Y,X))this.finishInitialization()}}handleResize(){if(this.pendingResize=!0,this.resizeDebounceTimer)clearTimeout(this.resizeDebounceTimer);this.resizeDebounceTimer=setTimeout(()=>{this.processResize()},10)}handleInbandResize(J){if(this.terminalSize={width:J.width,height:J.height},this.queryParser&&J.pixelWidth&&J.pixelHeight){let Q=this.queryParser.shouldUsePixelMouse();this.queryParser.updateInbandPixelData(J.width,J.height,J.pixelWidth,J.pixelHeight);let Y=this.queryParser.shouldUsePixelMouse();if(!Q&&Y)this.disableMouse(),this.enableMouse();if(Y){let X=J.pixelWidth/J.width,G=J.pixelHeight/J.height;this.parser?.setSgrToMouseConverter((Z)=>Sg(Z,!0,X,G))}}this.screen.resize(J.width,J.height),setImmediate(()=>{for(let Q of this.resizeHandlers)try{Q(J)}catch(Y){f.error("Error in resize handler:",Y)}})}processResize(){if(!this.pendingResize||!this.initialized)return;let J={...this.terminalSize};if(this.updateTerminalSize(),J.width===this.terminalSize.width&&J.height===this.terminalSize.height){this.pendingResize=!1;return}this.finishResize(),this.pendingResize=!1}finishResize(){this.screen.resize(this.terminalSize.width,this.terminalSize.height);let J={type:"resize",width:this.terminalSize.width,height:this.terminalSize.height};setImmediate(()=>{for(let Q of this.resizeHandlers)try{Q(J)}catch(Y){f.error("Error in resize handler:",Y)}})}setupCleanupHandlers(){process.setMaxListeners(0),process.on("SIGINT",this.boundCleanup),process.on("SIGTERM",this.boundCleanup),process.on("exit",this.boundCleanup),process.on("SIGCONT",this.boundHandleResume)}cleanup(){try{this.deinit()}catch{}}}function v96(J){return"isTTY"in J&&J.isTTY===!0&&typeof J.setRawMode==="function"}L0();L0();var yg;((G)=>{G.BUILD="build";G.LAYOUT="layout";G.PAINT="paint";G.RENDER="render"})(yg||={});var Vq8=60,nR1=1000/Vq8;class w9{static _instance;_frameCallbacks=new Map;_postFrameCallbacks=[];_frameScheduled=!1;_frameInProgress=!1;_stats={lastFrameTime:0,phaseStats:{["build"]:{lastTime:0},["layout"]:{lastTime:0},["paint"]:{lastTime:0},["render"]:{lastTime:0}}};_lastCompletedStats=this.deepCopyStats(this._stats);static get instance(){return this._instance??=new w9}requestFrame(){if(this._frameScheduled)return;this._frameScheduled=!0,setImmediate(()=>this.executeFrame())}addFrameCallback(J,Q,Y,X=0,G){this._frameCallbacks.set(J,{callback:Q,phase:Y,priority:X,name:G||J})}removeFrameCallback(J){this._frameCallbacks.delete(J)}addPostFrameCallback(J,Q){if(this._postFrameCallbacks.push({callback:J,name:Q}),!this._frameScheduled&&!this._frameInProgress)this.requestFrame()}executeFrame(){if(this._frameInProgress)return;let J=performance.now();this._frameScheduled=!1,this._frameInProgress=!0;try{for(let Q of["build","layout","paint","render"])this.executePhase(Q);this.executePostFrameCallbacks()}catch(Q){f.error("Frame execution error:",Q instanceof Error?Q.message:String(Q))}finally{this.recordFrameStats(performance.now()-J),this._lastCompletedStats=this.deepCopyStats(this._stats),this._frameInProgress=!1}}executePhase(J){let Q=performance.now();try{let Y=Array.from(this._frameCallbacks.values()).filter((X)=>X.phase===J).sort((X,G)=>X.priority-G.priority);for(let X of Y)try{X.callback()}catch(G){f.error(`Frame callback error in ${J} phase (${X.name})`,{errorMessage:G instanceof Error?G.message:String(G),errorType:G?.constructor?.name,stackTrace:G instanceof Error?G.stack:void 0}),L4(!1,`FATAL: ${J} error in ${X.name}: ${G}`)}}finally{let Y=performance.now()-Q;this.recordPhaseStats(J,Y)}}executePostFrameCallbacks(){if(this._postFrameCallbacks.length===0)return;let J=this._postFrameCallbacks.splice(0);for(let{callback:Q,name:Y}of J)try{Q()}catch(X){f.error(`Post-frame callback error (${Y||"anonymous"}):`,X instanceof Error?X.message:String(X))}}recordFrameStats(J){this._stats.lastFrameTime=J}recordPhaseStats(J,Q){this._stats.phaseStats[J].lastTime=Q}get isFrameScheduled(){return this._frameScheduled||this._frameInProgress}get isFrameInProgress(){return this._frameInProgress}get frameStats(){return this.deepCopyStats(this._lastCompletedStats)}deepCopyStats(J){return{...J,phaseStats:{["build"]:{...J.phaseStats.build},["layout"]:{...J.phaseStats.layout},["paint"]:{...J.phaseStats.paint},["render"]:{...J.phaseStats.render}}}}resetStats(){this._stats={lastFrameTime:0,phaseStats:{["build"]:{lastTime:0},["layout"]:{lastTime:0},["paint"]:{lastTime:0},["render"]:{lastTime:0}}}}get pendingPostFrameCallbacks(){return this._postFrameCallbacks.length}dispose(){this._frameCallbacks.clear(),this._postFrameCallbacks.length=0,this._frameScheduled=!1,this._frameInProgress=!1,this.resetStats()}}class aR1{_dirtyElements=new Set;_stats={totalRebuilds:0,elementsRebuiltThisFrame:0,maxElementsPerFrame:0,averageElementsPerFrame:0,lastBuildTime:0,averageBuildTime:0,maxBuildTime:0};_buildTimes=[];_elementsPerFrame=[];constructor(){}scheduleBuildFor(J){if(this._dirtyElements.has(J))return;this._dirtyElements.add(J),w9.instance.requestFrame()}buildScopes(){if(this._dirtyElements.size===0)return;let J=performance.now(),Q=0;try{while(this._dirtyElements.size>0){let Y=Array.from(this._dirtyElements);this._dirtyElements.clear(),Y.sort((X,G)=>X.depth-G.depth);for(let X of Y)if(X.dirty)try{X.performRebuild(),X._dirty=!1,Q++}catch(G){f.error("Element rebuild error:",{error:G instanceof Error?G.message:String(G),stack:G instanceof Error?G.stack:void 0,elementType:X.widget.constructor.name,elementDebugLabel:X.widget.debugLabel}),X._dirty=!1}}}finally{this.recordBuildStats(performance.now()-J,Q)}}recordBuildStats(J,Q){if(this._stats.totalRebuilds+=Q,this._stats.elementsRebuiltThisFrame=Q,this._stats.lastBuildTime=J,this._stats.maxElementsPerFrame=Math.max(this._stats.maxElementsPerFrame,Q),this._stats.maxBuildTime=Math.max(this._stats.maxBuildTime,J),this._buildTimes.push(J),this._elementsPerFrame.push(Q),this._buildTimes.length>60)this._buildTimes.shift(),this._elementsPerFrame.shift();this._stats.averageBuildTime=this._buildTimes.reduce((Y,X)=>Y+X,0)/this._buildTimes.length,this._stats.averageElementsPerFrame=this._elementsPerFrame.reduce((Y,X)=>Y+X,0)/this._elementsPerFrame.length}get dirtyElements(){return Array.from(this._dirtyElements)}get hasDirtyElements(){return this._dirtyElements.size>0}get buildStats(){return{...this._stats}}resetBuildStats(){this._stats={totalRebuilds:0,elementsRebuiltThisFrame:0,maxElementsPerFrame:0,averageElementsPerFrame:0,lastBuildTime:0,averageBuildTime:0,maxBuildTime:0},this._buildTimes.length=0,this._elementsPerFrame.length=0}dispose(){this._dirtyElements.clear()}}var oR1=null,rR1=null;function h96(J,Q){oR1=J,rR1=Q}function b96(){return typeof process<"u"&&(process.env.BUN_TEST==="1"||globalThis.Bun?.jest!==void 0||typeof globalThis.test==="function")}function g96(){if(!oR1){if(b96())return{scheduleBuildFor:()=>{}};throw Error("Build scheduler not initialized. Make sure WidgetsBinding is created.")}return oR1}function n61(){if(!rR1){if(b96())return{requestLayout:()=>{},requestPaint:()=>{},removeFromQueues:()=>{}};throw Error("Paint scheduler not initialized. Make sure WidgetsBinding is created.")}return rR1}L0();import Kq8 from"node:http";class qz{enabled;interval;static _instance=null;server=null;latestSnapshot=null;timer=null;rootElement=null;port;objectToId=new WeakMap;nextId=0;renderObjectToElementMap=new Map;keystrokeHistory=[];MAX_KEYSTROKE_HISTORY=50;constructor(J=!1,Q=1000,Y){this.enabled=J;this.interval=Q;this.port=Y??9876,qz._instance=this}static get instance(){return this._instance}start(J){if(!this.enabled)return;this.rootElement=J,this.startServer(),this.startPeriodicScan()}stop(){if(this.timer)clearInterval(this.timer),this.timer=null;if(this.server)this.server.close(),this.server=null;qz._instance=null}static recordKeystroke(J,Q,Y){let X=qz._instance;if(!X||!X.enabled)return;let G={timestamp:Date.now(),key:J,focusPath:Q,handled:Y};if(X.keystrokeHistory.push(G),X.keystrokeHistory.length>X.MAX_KEYSTROKE_HISTORY)X.keystrokeHistory.shift()}startServer(){this.server=Kq8.createServer((J,Q)=>{if(Q.setHeader("Access-Control-Allow-Origin","*"),Q.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),Q.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization"),J.method==="OPTIONS"){Q.writeHead(200),Q.end();return}if(J.url==="/widget-tree"&&J.method==="GET"){Q.setHeader("Content-Type","application/json"),Q.writeHead(200),Q.end(JSON.stringify(this.latestSnapshot||{timestamp:Date.now(),rootWidget:null}));return}if(J.url==="/focus-tree"&&J.method==="GET"){Q.setHeader("Content-Type","application/json"),Q.writeHead(200);let Y=kZ.instance.debugDumpFocusTree();Q.end(JSON.stringify(Y||{timestamp:Date.now(),rootScope:null}));return}if(J.url==="/health"&&J.method==="GET"){Q.setHeader("Content-Type","application/json"),Q.writeHead(200),Q.end(JSON.stringify({status:"ok",enabled:this.enabled}));return}Q.writeHead(404),Q.end("Not Found")}),this.server.listen(this.port,"localhost",()=>{f.info(`Widget Tree Debugger running on http://localhost:${this.port}`),f.info(`Widget Tree Data: http://localhost:${this.port}/widget-tree`)}),this.server.on("error",(J)=>{f.error("Widget Tree Debugger server error:",J)})}startPeriodicScan(){this.scanTree(),this.timer=setInterval(()=>{this.scanTree()},this.interval)}scanTree(){if(!this.rootElement)return;try{this.renderObjectToElementMap.clear(),this.buildRenderObjectElementMap(this.rootElement);let J=this.elementToDebugInfo(this.rootElement),Q=this.elementToElementDebugInfo(this.rootElement),Y=this.rootElement.renderObject?this.renderObjectToRenderTreeDebugInfo(this.rootElement.renderObject,this.rootElement):null;this.latestSnapshot={timestamp:Date.now(),rootWidget:J,rootElement:Q,rootRenderObject:Y,recentKeystrokes:[...this.keystrokeHistory]}}catch(J){f.error("Error scanning trees:",J)}}elementToDebugInfo(J){let Q=this.toId(J),Y=J.widget.constructor.name,X=J.widget.key?String(J.widget.key):void 0,G=J.depth,Z;if(J.renderObject)Z=this.renderObjectToDebugInfo(J.renderObject);let q=J.children.map((V)=>this.elementToDebugInfo(V));return{id:Q,type:Y,key:X,depth:G,renderObject:Z,children:q}}elementToElementDebugInfo(J){let Q=this.toId(J),Y=J.constructor.name,X=J.depth,G=J.dirty,Z=J.mounted,q=this.elementToDebugInfo(J),V;if(J.renderObject)V=this.renderObjectToDebugInfo(J.renderObject);let K=J.children.map((W)=>this.elementToElementDebugInfo(W));return{id:Q,type:Y,depth:X,dirty:G,mounted:Z,widget:q,renderObject:V,children:K}}renderObjectToRenderTreeDebugInfo(J,Q){let Y=this.toId(J),X=this.renderObjectToElementMap.get(J),G=X?this.toId(X):void 0,Z=J.constructor.name,q={},V=!1,K=!1,W=void 0,H=void 0,z=void 0,U=void 0;if(Q)U=this.getDebugData(Q,J);else{let M=this.renderObjectToElementMap.get(J);if(M)U=this.getDebugData(M,J);else if("debugData"in J){let L=J.debugData;if(L&&Object.keys(L).length>0)U=L}}try{if("needsLayout"in J)V=J.needsLayout;if("needsPaint"in J)K=J.needsPaint;if("size"in J)H=J.size;if("_lastConstraints"in J)W=J._lastConstraints;if("offset"in J){let L=J.offset;if(L&&typeof L==="object"&&"x"in L&&"y"in L)z={x:L.x,y:L.y}}let M=Object.getOwnPropertyNames(J);for(let L of M)if(!L.startsWith("_")&&L!=="constructor"&&!["needsLayout","needsPaint","size","constraints","offset"].includes(L))try{let A=J[L];if(typeof A!=="function"&&typeof A!=="object")q[L]=A}catch{}}catch(M){q.error=`Failed to extract properties: ${M}`}let N=[];try{if("children"in J&&Array.isArray(J.children)){let M=J.children;for(let L of M)N.push(this.renderObjectToRenderTreeDebugInfo(L))}}catch{}return{id:Y,type:Z,constraints:W,size:H,offset:z,needsLayout:V,needsPaint:K,properties:q,debugData:U,elementId:G,children:N}}renderObjectToDebugInfo(J){let Q=J.constructor.name,Y={};try{if("size"in J)Y.size=J.size;if("constraints"in J)Y.constraints=J.constraints;if("offset"in J)Y.offset=J.offset;let X=Object.getOwnPropertyNames(J);for(let G of X)if(!G.startsWith("_")&&G!=="constructor")try{let Z=J[G];if(typeof Z!=="function")Y[G]=Z}catch{}}catch(X){Y.error=`Failed to extract properties: ${X}`}return{type:Q,properties:Y}}getLatestSnapshot(){return this.latestSnapshot}forceScan(){this.scanTree()}buildRenderObjectElementMap(J){if(J.renderObject)this.renderObjectToElementMap.set(J.renderObject,J);for(let Q of J.children)this.buildRenderObjectElementMap(Q)}toId(J){let Q=this.objectToId.get(J);if(Q===void 0)Q=`inspector-${this.nextId++}`,this.objectToId.set(J,Q);return Q}getDebugData(J,Q){let Y={};if("debugData"in J.widget){let G=J.widget.debugData;if(G&&Object.keys(G).length>0)Y={...Y,...G}}let X=Q||J.renderObject;if(X&&"debugData"in X){let G=X.debugData;if(G&&Object.keys(G).length>0)Y={...Y,...G}}return Object.keys(Y).length>0?Y:void 0}}class i8{static _nextDebugId=0;_debugId;_parent=null;_children=new Set;_hasPrimaryFocus=!1;_canRequestFocus=!0;_skipTraversal=!1;_keyHandlers=[];_onPasteCallback=null;_listeners=new Set;_debugLabel=null;static _requestFocusCallback=null;constructor(J={}){if(this._debugId=`focus-${i8._nextDebugId++}`,this._debugLabel=J.debugLabel??null,this._canRequestFocus=J.canRequestFocus??!0,this._skipTraversal=J.skipTraversal??!1,J.onKey)this._keyHandlers.push(J.onKey);this._onPasteCallback=J.onPaste??null}get debugId(){return this._debugId}get hasPrimaryFocus(){return this._hasPrimaryFocus}get hasFocus(){let J=kZ.instance.primaryFocus;return this._hasPrimaryFocus||(J?._isDecendantOf(this)??!1)}get canRequestFocus(){return this._canRequestFocus}set canRequestFocus(J){if(this._canRequestFocus!==J){if(this._canRequestFocus=J,!J&&this._hasPrimaryFocus)this.unfocus()}}get skipTraversal(){return this._skipTraversal}set skipTraversal(J){this._skipTraversal=J}get parent(){return this._parent}get children(){return this._children}get debugLabel(){return this._debugLabel}get onPaste(){return this._onPasteCallback}set onPaste(J){this._onPasteCallback=J}static setRequestFocusCallback(J){i8._requestFocusCallback=J}requestFocus(){if(!this._canRequestFocus)return!1;if(i8._requestFocusCallback)return i8._requestFocusCallback(this);return!1}unfocus(){if(this._hasPrimaryFocus){if(i8._requestFocusCallback)i8._requestFocusCallback(null)}}_isDecendantOf(J){if(J===null)return!1;if(this._parent===J)return!0;return this._parent?._isDecendantOf(J)??!1}_isAncestorTo(J){return J?._isDecendantOf(this)??!1}_attach(J){if(this._parent===J)return;if(this._parent)this._parent._children.delete(this);if(this._parent=J,J)J._children.add(this);if(i8._requestFocusCallback){let Q=i8._requestFocusCallback.__focusManager;if(Q&&Q._invalidateFocusableNodesCache)Q._invalidateFocusableNodesCache()}}_detach(){if(this._parent)this._parent._children.delete(this),this._parent=null;if(i8._requestFocusCallback){let J=i8._requestFocusCallback.__focusManager;if(J&&J._invalidateFocusableNodesCache)J._invalidateFocusableNodesCache()}if(this._hasPrimaryFocus)this.unfocus()}_setFocus(J){if(this._hasPrimaryFocus===J)return;let Q=this.hasFocus;this._hasPrimaryFocus=J;let Y=this.hasFocus;if(this._notifyListeners(),Q!==Y)this._notifyAncestorListeners()}addListener(J){this._listeners.add(J)}removeListener(J){this._listeners.delete(J)}_notifyListeners(){for(let J of this._listeners)J(this)}_notifyAncestorListeners(){let J=this._parent;while(J)J._notifyListeners(),J=J._parent}_handleKeyEvent(J){return this.handleKeyEvent(J)}_handlePasteEvent(J){if(this._onPasteCallback)return this._onPasteCallback(J);return"ignored"}toStringShort(){let J=this._debugLabel?`"${this._debugLabel}"`:"",Q=this._hasPrimaryFocus?" FOCUSED":"",Y=this._canRequestFocus?"":" (can't focus)";return`FocusNode${J}${Q}${Y}`}toStringDeep(J="",Q=!0){let Y=J+this.toStringShort();if(Q&&this._children.size>0){let X=J+" ";for(let G of this._children)Y+=`
|
|
4369
4369
|
`+G.toStringDeep(X,!0)}return Y}addKeyHandler(J){this._keyHandlers.push(J)}removeKeyHandler(J){let Q=this._keyHandlers.indexOf(J);if(Q!==-1)this._keyHandlers.splice(Q,1)}handleKeyEvent(J){for(let Q of this._keyHandlers)if(Q(J)==="handled")return"handled";return"ignored"}dispose(){this._detach(),this._children.clear(),this._keyHandlers=[]}}class kZ{static _instance=null;_rootScope;_primaryFocus=null;_cachedFocusableNodes=null;_primaryFocusStack=[];constructor(){this._rootScope=new i8({debugLabel:"Root Focus Scope",canRequestFocus:!1});let J=(Q)=>this.requestFocus(Q);J.__focusManager=this,i8.setRequestFocusCallback(J)}static get instance(){if(!this._instance)this._instance=new kZ;return this._instance}get primaryFocus(){return this._primaryFocus}get rootScope(){return this._rootScope}requestFocus(J){if(this._primaryFocus===J)return!0;if(J&&!J.canRequestFocus)return!1;if(J&&!J.parent)return!1;if(this._primaryFocus)this._primaryFocus._setFocus(!1);if(J===null){let Q=this._primaryFocus;if(Q)this._popFromFocusStack(Q);let Y=this._findPreviousFocusableNode();if(this._primaryFocus=Y,Y)Y._setFocus(!0);return!0}return this._primaryFocus=J,J._setFocus(!0),this._pushToFocusStack(J),!0}handleKeyEvent(J){if(!this._primaryFocus)return!1;let Q=void 0,Y=this._primaryFocus;while(Y){let G=Y._handleKeyEvent(J)==="handled";if(Q)Q.push({id:Y.debugId,debugLabel:Y.debugLabel,handled:G});if(G){if(Q)qz.recordKeystroke(this.formatKeyEvent(J),Q,!0);return!0}Y=Y.parent}if(Q)qz.recordKeystroke(this.formatKeyEvent(J),Q,!1);return!1}formatKeyEvent(J){let Q=[];if(J.ctrlKey)Q.push("Ctrl");if(J.altKey)Q.push("Alt");if(J.shiftKey)Q.push("Shift");if(J.metaKey)Q.push("Meta");if(J.key)Q.push(J.key);return Q.join("+")}handlePasteEvent(J){if(!this._primaryFocus)return!1;let Q=this._primaryFocus;while(Q){if(Q._handlePasteEvent(J)==="handled")return!0;Q=Q.parent}return!1}registerNode(J,Q=null){L4(J!==Q,"Focus node cannot be its own parent"),this._invalidateFocusableNodesCache();let Y=Q??this._rootScope;J._attach(Y)}unregisterNode(J){if(this._invalidateFocusableNodesCache(),this._popFromFocusStack(J),this._primaryFocus===J)this.requestFocus(null);J._detach()}findNearestFocusableAncestor(J){let Q=J.parent;while(Q){if(Q.canRequestFocus&&!Q.skipTraversal)return Q;Q=Q.parent}return null}findAllFocusableNodes(){if(this._cachedFocusableNodes!==null)return this._cachedFocusableNodes;let J=[],Q=(Y)=>{if(Y.canRequestFocus&&!Y.skipTraversal)J.push(Y);for(let X of Y.children)Q(X)};return Q(this._rootScope),this._cachedFocusableNodes=J,J}_invalidateFocusableNodesCache(){this._cachedFocusableNodes=null}_pushToFocusStack(J){let Q=this._primaryFocusStack.indexOf(J);if(Q!==-1)this._primaryFocusStack.splice(Q,1);this._primaryFocusStack.push(J)}_popFromFocusStack(J){let Q=this._primaryFocusStack.indexOf(J);while(Q!==-1)this._primaryFocusStack.splice(Q,1),Q=this._primaryFocusStack.indexOf(J)}_findPreviousFocusableNode(){while(this._primaryFocusStack.length>0){let J=this._primaryFocusStack[this._primaryFocusStack.length-1];if(J.parent&&J.canRequestFocus&&!J.skipTraversal)return J;else this._primaryFocusStack.pop()}return null}focusNext(){let J=this.findAllFocusableNodes();if(J.length===0)return!1;if(!this._primaryFocus)return this.requestFocus(J[0]??null);let Q=J.indexOf(this._primaryFocus);if(Q===-1)return this.requestFocus(J[0]??null);let Y=(Q+1)%J.length;return this.requestFocus(J[Y]??null)}focusPrevious(){let J=this.findAllFocusableNodes();if(J.length===0)return!1;if(!this._primaryFocus)return this.requestFocus(J[J.length-1]??null);let Q=J.indexOf(this._primaryFocus);if(Q===-1)return this.requestFocus(J[J.length-1]??null);let Y=Q===0?J.length-1:Q-1;return this.requestFocus(J[Y]??null)}_focusNodeToDebugInfo(J){return{id:J.debugId,debugLabel:J.debugLabel,hasPrimaryFocus:J.hasPrimaryFocus,hasFocus:J.hasFocus,canRequestFocus:J.canRequestFocus,skipTraversal:J.skipTraversal,isPrimaryFocus:this._primaryFocus===J,children:Array.from(J.children).map((Q)=>this._focusNodeToDebugInfo(Q))}}debugDumpFocusTree(){return null}dispose(){this._primaryFocus=null,this._cachedFocusableNodes=null,this._primaryFocusStack=[],this._rootScope.dispose(),kZ._instance=null}}function a61(J){if(J.length===0)return 0;let Q=[...J].sort((X,G)=>X-G),Y=Math.ceil(Q.length*0.99)-1;return Q[Math.max(0,Y)]||0}class m96{frameTimes=[];phaseTimes={build:[],layout:[],paint:[],render:[]};keyEventTimes=[];mouseEventTimes=[];lastKeyEventTime=0;lastMouseEventTime=0;MAX_SAMPLES=1024;recordFrame(J){if(this.frameTimes.push(J),this.frameTimes.length>this.MAX_SAMPLES)this.frameTimes.shift()}recordPhase(J,Q){let Y=this.phaseTimes[J];if(Y.push(Q),Y.length>this.MAX_SAMPLES)Y.shift()}recordKeyEvent(J){if(this.lastKeyEventTime=J,this.keyEventTimes.push(J),this.keyEventTimes.length>this.MAX_SAMPLES)this.keyEventTimes.shift()}recordMouseEvent(J){if(this.lastMouseEventTime=J,this.mouseEventTimes.push(J),this.mouseEventTimes.length>this.MAX_SAMPLES)this.mouseEventTimes.shift()}getFrameP99(){return a61(this.frameTimes)}getPhaseP99(J){return a61(this.phaseTimes[J])}getLastKeyEventTime(){return this.lastKeyEventTime}getKeyEventP99(){return a61(this.keyEventTimes)}getLastMouseEventTime(){return this.lastMouseEventTime}getMouseEventP99(){return a61(this.mouseEventTimes)}reset(){this.frameTimes=[];for(let J of Object.values(yg))this.phaseTimes[J]=[];this.keyEventTimes=[],this.mouseEventTimes=[],this.lastKeyEventTime=0,this.lastMouseEventTime=0}}class sR1{enabled=!1;tracker=new m96;setEnabled(J){this.enabled=J}isEnabled(){return this.enabled}recordKeyEvent(J){this.tracker.recordKeyEvent(J)}recordMouseEvent(J){this.tracker.recordMouseEvent(J)}recordStats(J){this.tracker.recordFrame(J.lastFrameTime);for(let Q of Object.values(yg))this.tracker.recordPhase(Q,J.phaseStats[Q].lastTime)}draw(J,Q){if(!this.enabled)return;let{width:Y,height:X}=J.getSize(),G=26,Z=12,q=Y-G-2,V=1;if(q<0||V+Z>=X)return;let K=O1.default(),W=O1.brightWhite,H=O1.yellow,z=" Gotta Go Fast ",U=Math.floor((G-z.length)/2);J.setCell(q,V,J9("╭",{fg:W}));for(let l=1;l<G-1;l++)if(l>=U&&l<U+z.length)J.setCell(q+l,V,J9(z[l-U]||"─",{fg:H}));else J.setCell(q+l,V,J9("─",{fg:W}));J.setCell(q+G-1,V,J9("╮",{fg:W}));for(let l=1;l<Z-1;l++){J.setCell(q,V+l,J9("│",{fg:W})),J.setCell(q+G-1,V+l,J9("│",{fg:W}));for(let F1=1;F1<G-1;F1++)J.setCell(q+F1,V+l,J9(" ",{fg:W}))}J.setCell(q,V+Z-1,J9("╰",{fg:W}));for(let l=1;l<G-1;l++)J.setCell(q+l,V+Z-1,J9("─",{fg:W}));J.setCell(q+G-1,V+Z-1,J9("╯",{fg:W}));let N=q+1,M=V+1;this.drawText(J,N,M++," Last P99",K);let L=this.tracker.getLastKeyEventTime(),A=this.tracker.getKeyEventP99(),E=L.toFixed(2).padStart(5," "),P=A.toFixed(2).padStart(5," "),I=this.getTimingColor(L),R=this.getTimingColor(A),S=` ${"Key".padStart(6," ")} `;this.drawText(J,N,M,S,K),this.drawText(J,N+S.length,M,E,I),this.drawText(J,N+S.length+E.length,M," ",K),this.drawText(J,N+S.length+E.length+3,M++,P,R);let y=this.tracker.getLastMouseEventTime(),h=this.tracker.getMouseEventP99(),u=y.toFixed(2).padStart(5," "),p=h.toFixed(2).padStart(5," "),g=this.getTimingColor(y),i=this.getTimingColor(h),Y1=` ${"Mouse".padStart(6," ")} `;this.drawText(J,N,M,Y1,K),this.drawText(J,N+Y1.length,M,u,g),this.drawText(J,N+Y1.length+u.length,M," ",K),this.drawText(J,N+Y1.length+u.length+3,M++,p,i),M++;for(let l of["build","layout","paint","render"]){let F1=Q.phaseStats[l].lastTime,y1=this.tracker.getPhaseP99(l),t=F1.toFixed(2).padStart(5," "),f1=y1.toFixed(2).padStart(5," "),j1=this.getTimingColor(F1),w0=this.getTimingColor(y1),s1=` ${(l.charAt(0).toUpperCase()+l.slice(1)).padStart(6," ")} `;this.drawText(J,N,M,s1,K),this.drawText(J,N+s1.length,M,t,j1),this.drawText(J,N+s1.length+t.length,M," ",K),this.drawText(J,N+s1.length+t.length+3,M++,f1,w0)}M++;let a=Q.lastFrameTime,b=this.tracker.getFrameP99(),s=a.toFixed(2).padStart(5," "),q1=b.toFixed(2).padStart(5," "),K1=this.getTimingColor(a),o=this.getTimingColor(b),r=` ${"Frame".padStart(6," ")} `;this.drawText(J,N,M,r,W),this.drawText(J,N+r.length,M,s,K1),this.drawText(J,N+r.length+s.length,M," ",W),this.drawText(J,N+r.length+s.length+3,M++,q1,o)}getTimingColor(J){let Q=nR1,Y=nR1*0.7;if(J>=Q)return O1.red;if(J>=Y)return O1.yellow;return O1.default()}drawText(J,Q,Y,X,G){for(let Z=0;Z<X.length;Z++)J.setCell(Q+Z,Y,J9(X[Z]||" ",{fg:G}))}}class o61{constructor(){}}class n7 extends o61{value;constructor(J){super();this.value=J}equals(J){if(!(J instanceof n7))return!1;return this.value===J.value}get hashCode(){if(this.value===null||this.value===void 0)return 0;if(typeof this.value==="string")return this.stringHash(this.value);if(typeof this.value==="number")return this.value;if(typeof this.value==="boolean")return this.value?1:0;return this.stringHash(String(this.value))}stringHash(J){let Q=0;for(let Y=0;Y<J.length;Y++){let X=J.charCodeAt(Y);Q=(Q<<5)-Q+X,Q=Q&Q}return Q}toString(){return`ValueKey(${this.value})`}}class yZ extends o61{static _registry=new Map;static _counter=0;_id;_currentElement;constructor(J){super();if(J)this._id=`${J}_${yZ._counter++}`;else this._id=`GlobalKey_${yZ._counter++}`;yZ._registry.set(this._id,this)}equals(J){if(!(J instanceof yZ))return!1;return this._id===J._id}get hashCode(){return this.stringHash(this._id)}stringHash(J){let Q=0;for(let Y=0;Y<J.length;Y++){let X=J.charCodeAt(Y);Q=(Q<<5)-Q+X,Q=Q&Q}return Q}get currentElement(){return this._currentElement}get currentWidget(){return this._currentElement?.widget}_setElement(J){L4(this._currentElement===void 0,`GlobalKey ${this._id} is already associated with an element. Each GlobalKey can only be used once in the widget tree.`),this._currentElement=J}_clearElement(){this._currentElement=void 0,yZ._registry.delete(this._id)}toString(){return`GlobalKey(${this._id})`}static _clearRegistry(){yZ._registry.clear(),yZ._counter=0}}class ZQ{key;_debugData={};constructor({key:J}={}){if(this.constructor===ZQ)throw Error("Widget is abstract and cannot be instantiated directly");this.key=J}sendDebugData(J){this._debugData={...this._debugData,...J}}get debugData(){return this._debugData}canUpdate(J){if(this.constructor!==J.constructor)return!1;if(this.key===void 0&&J.key===void 0)return!0;if(this.key===void 0||J.key===void 0)return!1;return this.key.equals(J.key)}}class sX{widget;parent;_children=[];_inheritedDependencies=new Set;_dirty=!1;_cachedDepth;_mounted=!1;constructor(J){this.widget=J}get children(){return this._children}get depth(){if(this._cachedDepth!==void 0)return this._cachedDepth;let J=0,Q=this.parent;while(Q)J++,Q=Q.parent;return this._cachedDepth=J,J}_invalidateDepth(){this._cachedDepth=void 0;for(let J of this._children)J._invalidateDepth()}get dirty(){return this._dirty}get mounted(){return this._mounted}get renderObject(){return}update(J){this.widget=J}addChild(J){J.parent=this,J._invalidateDepth(),this._children.push(J)}removeChild(J){let Q=this._children.indexOf(J);if(Q!==-1)this._children.splice(Q,1),J.parent=void 0,J._invalidateDepth()}removeAllChildren(){for(let J of this._children)J.parent=void 0,J._invalidateDepth();this._children.length=0}markMounted(){if(this._mounted=!0,this.widget.key instanceof yZ)this.widget.key._setElement(this)}unmount(){if(this.widget.key instanceof yZ)this.widget.key._clearElement();this._mounted=!1,this._dirty=!1,this._cachedDepth=void 0;for(let J of this._inheritedDependencies)if("removeDependent"in J)J.removeDependent(this);this._inheritedDependencies.clear()}markNeedsRebuild(){if(!this._mounted)return;this._dirty=!0,g96().scheduleBuildFor(this)}dependOnInheritedWidgetOfExactType(J){let Q=this.parent;while(Q){if(Q.widget.constructor===J){if("addDependent"in Q)Q.addDependent(this),this._inheritedDependencies.add(Q);return Q}Q=Q.parent}return null}findAncestorElementOfType(J){let Q=this.parent;while(Q){if(Q instanceof J)return Q;Q=Q.parent}return null}findAncestorWidgetOfType(J){let Q=this.parent;while(Q){if(Q.widget instanceof J)return Q.widget;Q=Q.parent}return null}}class NJ extends ZQ{child;constructor({key:J,child:Q}){super(J!==void 0?{key:J}:{});this.child=Q}createElement(){return new u96(this)}}class u96 extends sX{_child;_dependents=new Set;constructor(J){super(J)}get inheritedWidget(){return this.widget}get child(){return this._child}get renderObject(){return this._child?.renderObject}mount(){this._child=this.inheritedWidget.child.createElement(),this.addChild(this._child),this._child.mount(),this.markMounted()}unmount(){if(this._child)this._child.unmount(),this.removeChild(this._child),this._child=void 0;this._dependents.clear(),super.unmount()}update(J){let Q=this.inheritedWidget;super.update(J);let Y=this.inheritedWidget;if(Y.updateShouldNotify(Q))this.notifyDependents();if(this._child&&this._child.widget.canUpdate(Y.child))this._child.update(Y.child);else{if(this._child)this._child.unmount(),this.removeChild(this._child);this._child=Y.child.createElement(),this.addChild(this._child),this._child.mount()}}addDependent(J){this._dependents.add(J)}removeDependent(J){this._dependents.delete(J)}notifyDependents(){for(let J of this._dependents)J.markNeedsRebuild()}performRebuild(){}}class rR{size;capabilities;constructor(J,Q){this.size=J;this.capabilities=Q}get supportsEmojiWidth(){return this.capabilities.emojiWidth}get supportsSyncOutput(){return this.capabilities.syncOutput}}class U8 extends NJ{data;constructor({key:J,data:Q,child:Y}){super(J!==void 0?{key:J,child:Y}:{child:Y});this.data=Q}updateShouldNotify(J){return this.data!==J.data||this.data.size.width!==J.data.size.width||this.data.size.height!==J.data.size.height||this.data.capabilities!==J.data.capabilities}static of(J){let Q=J.dependOnInheritedWidgetOfExactType(U8);if(Q)return Q.widget.data;throw Error("MediaQuery not found in context. Wrap your app with MediaQuery widget.")}static sizeOf(J){return U8.of(J).size}static capabilitiesOf(J){return U8.of(J).capabilities}}class aB{_parent;_children=[];_needsLayout=!1;_needsPaint=!1;_cachedDepth;_attached=!1;_debugData={};allowHitTestOutsideBounds=!1;parentData;setupParentData(J){}sendDebugData(J){this._debugData={...this._debugData,...J}}get debugData(){return this._debugData}get parent(){return this._parent}get children(){return this._children}get depth(){if(this._cachedDepth!==void 0)return this._cachedDepth;let J=0,Q=this._parent;while(Q)J++,Q=Q._parent;return this._cachedDepth=J,J}_invalidateDepth(){this._cachedDepth=void 0;for(let J of this._children)J._invalidateDepth()}get needsLayout(){return this._needsLayout}get needsPaint(){return this._needsPaint}get attached(){return this._attached}adoptChild(J){if(J._parent=this,J._invalidateDepth(),this._children.push(J),this.setupParentData(J),this._attached)J.attach();this.markNeedsLayout()}dropChild(J){let Q=this._children.indexOf(J);if(Q!==-1){if(J._attached)J.detach();this._children.splice(Q,1),J._parent=void 0,J._invalidateDepth(),this.markNeedsLayout()}}removeAllChildren(){for(let J of this._children){if(J._attached)J.detach();J._parent=void 0,J._invalidateDepth()}this._children.length=0,this.markNeedsLayout()}replaceChildren(J){for(let Q of J)Q._parent=this,Q._invalidateDepth(),this.setupParentData(Q);this._children=J,this.markNeedsLayout()}attach(){if(this._attached)return;this._attached=!0;for(let J of this._children)J.attach()}detach(){if(!this._attached)return;this._attached=!1;for(let J of this._children)J.detach()}markNeedsLayout(){if(this._needsLayout)return;if(!this._attached)return;if(this._needsLayout=!0,this.parent)this.parent.markNeedsLayout();else n61().requestLayout(this)}markNeedsPaint(){if(this._needsPaint)return;if(!this._attached)return;this._needsPaint=!0,n61().requestPaint(this)}performLayout(){}paint(J,Q=0,Y=0){this._needsPaint=!1;for(let X of this.children)if("offset"in X){let G=X,Z=Q+G.offset.x,q=Y+G.offset.y;X.paint(J,Z,q)}else X.paint(J,Q,Y)}visitChildren(J){for(let Q of this._children)J(Q)}dispose(){n61().removeFromQueues(this),this._cachedDepth=void 0,this._parent=void 0,this._children.length=0}}class v4 extends aB{_size={width:0,height:0};get size(){return{...this._size}}setSize(J,Q){L4(Number.isFinite(J)&&Number.isFinite(Q),`RenderBox.setSize received non-finite dimension: ${J}x${Q}`),this._size.width=J,this._size.height=Q}_offset={x:0,y:0};get offset(){return{...this._offset}}setOffset(J,Q){let Y=Number.isFinite(J)?Math.round(J):0,X=Number.isFinite(Q)?Math.round(Q):0;this._offset.x=Y,this._offset.y=X}localToGlobal(J){let{x:Q,y:Y}=J,X=this;while(X)if(Q+=X._offset.x,Y+=X._offset.y,X=X.parent,X&&!("_offset"in X))break;return{x:Q,y:Y}}globalToLocal(J){let Q=this.localToGlobal({x:0,y:0});return{x:J.x-Q.x,y:J.y-Q.y}}_lastConstraints;layout(J){let Q=!this._lastConstraints||!J.equals(this._lastConstraints);if(!this._needsLayout&&!Q)return;this._lastConstraints=J,this._needsLayout=!1,this.performLayout()}getMinIntrinsicWidth(J){let Q=this.children;if(Q.length===0)return 0;let Y=0;for(let X of Q)Y=Math.max(Y,X.getMinIntrinsicWidth(J));return Y}getMaxIntrinsicWidth(J){let Q=this.children;if(Q.length===0)return 0;let Y=0;for(let X of Q)Y=Math.max(Y,X.getMaxIntrinsicWidth(J));return Y}getMinIntrinsicHeight(J){let Q=this.children;if(Q.length===0)return 0;let Y=0;for(let X of Q)Y=Math.max(Y,X.getMinIntrinsicHeight(J));return Y}getMaxIntrinsicHeight(J){let Q=this.children;if(Q.length===0)return 0;let Y=0;for(let X of Q)Y=Math.max(Y,X.getMaxIntrinsicHeight(J));return Y}paint(J,Q=0,Y=0){let X=J.getSize(),G=X.width,Z=X.height;for(let q of this.children)if(q instanceof v4){let V=Q+this.offset.x+q.offset.x,K=Y+this.offset.y+q.offset.y,W=V+q.size.width,H=K+q.size.height;if(!(V>=G||K>=Z||W<=0||H<=0))q.paint(J,Q+this.offset.x,Y+this.offset.y)}}hitTest(J,Q,Y=0,X=0){let G=Y+this.offset.x,Z=X+this.offset.y,q=Q.x>=G&&Q.x<G+this.size.width,V=Q.y>=Z&&Q.y<Z+this.size.height;if(q&&V){J.addWithPaintOffset(this,{x:G,y:Z},Q);let K=!0;for(let W=this.children.length-1;W>=0;W--)if(this.children[W].hitTest(J,Q,G,Z))K=!0;return K}if(this.allowHitTestOutsideBounds){let K=!1;for(let W=this.children.length-1;W>=0;W--)if(this.children[W].hitTest(J,Q,G,Z))K=!0;return K}return!1}}function xg(J,Q=0){return Number.isFinite(J)?J:Q}class r6{minWidth;maxWidth;minHeight;maxHeight;constructor(J,Q,Y,X){if(typeof J==="object")this.minWidth=J.minWidth??0,this.maxWidth=J.maxWidth??1/0,this.minHeight=J.minHeight??0,this.maxHeight=J.maxHeight??1/0;else this.minWidth=J??0,this.maxWidth=Q??1/0,this.minHeight=Y??0,this.maxHeight=X??1/0}static tight(J,Q){return new r6(J,J,Q,Q)}static loose(J,Q){return new r6(0,J,0,Q)}get hasBoundedWidth(){return this.maxWidth!==1/0}get hasBoundedHeight(){return this.maxHeight!==1/0}get hasTightWidth(){return this.minWidth>=this.maxWidth}get hasTightHeight(){return this.minHeight>=this.maxHeight}constrain(J,Q){return L4(isFinite(J),`BoxConstraints.constrain received infinite width: ${J}. This indicates a layout bug where a widget is not properly calculating its desired size.`),L4(isFinite(Q),`BoxConstraints.constrain received infinite height: ${Q}. This indicates a layout bug where a widget is not properly calculating its desired size.`),{width:Math.max(this.minWidth,Math.min(this.maxWidth,J)),height:Math.max(this.minHeight,Math.min(this.maxHeight,Q))}}enforce(J){let Q=(Y,X,G)=>Math.max(X,Math.min(G,Y));return new r6(Q(J.minWidth,this.minWidth,this.maxWidth),Q(J.maxWidth,this.minWidth,this.maxWidth),Q(J.minHeight,this.minHeight,this.maxHeight),Q(J.maxHeight,this.minHeight,this.maxHeight))}get biggest(){return{width:this.maxWidth,height:this.maxHeight}}get smallest(){return{width:this.minWidth,height:this.minHeight}}loosen(){return new r6(0,this.maxWidth,0,this.maxHeight)}tighten({width:J,height:Q}={}){return new r6(J===void 0?this.minWidth:Math.max(this.minWidth,Math.min(this.maxWidth,J)),J===void 0?this.maxWidth:Math.max(this.minWidth,Math.min(this.maxWidth,J)),Q===void 0?this.minHeight:Math.max(this.minHeight,Math.min(this.maxHeight,Q)),Q===void 0?this.maxHeight:Math.max(this.minHeight,Math.min(this.maxHeight,Q)))}static tightFor({width:J,height:Q}={}){return new r6(J??0,J??1/0,Q??0,Q??1/0)}equals(J){return this.minWidth===J.minWidth&&this.maxWidth===J.maxWidth&&this.minHeight===J.minHeight&&this.maxHeight===J.maxHeight}}class sR extends ZQ{constructor({key:J}={}){super(J!==void 0?{key:J}:{})}createElement(){return new vg(this)}updateRenderObject(J){}}class K7 extends sR{child;constructor({key:J,child:Q}={}){super(J?{key:J}:{});this.child=Q}createElement(){return new CK(this)}}class tX extends sR{children;constructor({key:J,children:Q=[]}={}){super(J?{key:J}:{});this.children=[...Q]}createElement(){return new r61(this)}}class Vz extends sR{constructor({key:J}={}){super(J?{key:J}:{})}createElement(){return new oB(this)}}class vg extends sX{_renderObject;constructor(J){super(J)}get renderObjectWidget(){return this.widget}get renderObject(){return this._renderObject}mount(){this._renderObject=this.renderObjectWidget.createRenderObject(),this._renderObject.attach(),this.markMounted()}unmount(){if(this._renderObject)this._renderObject.detach(),this._renderObject=void 0;super.unmount()}update(J){super.update(J);let Q=this.renderObjectWidget;if(this._renderObject)Q.updateRenderObject(this._renderObject)}performRebuild(){}}class CK extends vg{_child;constructor(J){super(J)}get singleChildWidget(){return this.widget}get child(){return this._child}mount(){if(super.mount(),this.singleChildWidget.child){if(this._child=this.singleChildWidget.child.createElement(),this.addChild(this._child),this._child.mount(),this._child.renderObject&&this.renderObject)this.renderObject.adoptChild(this._child.renderObject)}}unmount(){if(this._child)this._child.unmount(),this.removeChild(this._child),this._child=void 0;super.unmount()}update(J){super.update(J);let Q=this.singleChildWidget;if(Q.child&&this._child){if(this._child.widget.canUpdate(Q.child))this._child.update(Q.child);else if(this._child.unmount(),this.removeChild(this._child),this._child=Q.child.createElement(),this.addChild(this._child),this._child.mount(),this.renderObject){if(this.renderObject.removeAllChildren(),this._child.renderObject)this.renderObject.adoptChild(this._child.renderObject)}}else if(Q.child&&!this._child){if(this._child=Q.child.createElement(),this.addChild(this._child),this._child.mount(),this.renderObject&&this._child.renderObject)this.renderObject.adoptChild(this._child.renderObject)}else if(!Q.child&&this._child){if(this._child.unmount(),this.removeChild(this._child),this._child=void 0,this.renderObject)this.renderObject.removeAllChildren()}}performRebuild(){}}class r61 extends vg{_childElements=[];constructor(J){super(J)}get multiChildWidget(){return this.widget}get children(){return this._childElements}mount(){super.mount();for(let J of this.multiChildWidget.children){let Q=J.createElement();if(this._childElements.push(Q),this.addChild(Q),Q.mount(),Q.renderObject&&this.renderObject)this.renderObject.adoptChild(Q.renderObject)}}unmount(){for(let J of this._childElements)J.unmount(),this.removeChild(J);this._childElements.length=0,super.unmount()}update(J){super.update(J);let Q=this.multiChildWidget;this.updateChildren(this._childElements,[...Q.children])}updateChildren(J,Q){let Y=[],X=0,G=0,Z=J.length-1,q=Q.length-1;while(X<=Z&&G<=q){let K=J[X],W=Q[G];if(!K||!W||!K.widget.canUpdate(W))break;if(K.widget!==W)K.update(W);Y.push(K),X++,G++}let V=[];while(X<=Z&&G<=q){let K=J[Z],W=Q[q];if(!K||!W||!K.widget.canUpdate(W))break;if(K.widget!==W)K.update(W);V.unshift(K),Z--,q--}if(X>Z)for(let K=G;K<=q;K++){let W=Q[K];if(W){let H=this.createChildElement(W);Y.push(H)}}else if(G>q)for(let K=X;K<=Z;K++){let W=J[K];if(W)this.deactivateChild(W)}else{let K=new Map,W=new Map;for(let H=X;H<=Z;H++){let z=J[H];if(z.widget.key){let U=z.widget.key.toString();K.set(U,z),W.set(U,H)}}for(let H=G;H<=q;H++){let z=Q[H];if(!z)continue;let U;if(z.key){let N=z.key.toString();if(U=K.get(N),U){K.delete(N);let M=W.get(N);if(M!==void 0)J[M]=null;if(U.widget===z);else if(U.widget.canUpdate(z))U.update(z);else this.deactivateChild(U),U=this.createChildElement(z)}else U=this.createChildElement(z)}else{let N=!1;for(let M=X;M<=Z;M++){let L=J[M];if(L&&!L.widget.key){if(L.widget===z){U=L,J[M]=null,N=!0;break}else if(L.widget.canUpdate(z)){U=L,J[M]=null,U.update(z),N=!0;break}}}if(!N)U=this.createChildElement(z)}if(U)Y.push(U)}for(let H=X;H<=Z;H++){let z=J[H];if(z)this.deactivateChild(z)}for(let H of K.values())this.deactivateChild(H)}if(Y.push(...V),this._childElements=Y,this.renderObject){let K=[];for(let z of Y)if(z.renderObject)K.push(z.renderObject);let W=this.renderObject.children;if(W.length!==K.length||W.some((z,U)=>z!==K[U]))this.renderObject.replaceChildren(K)}}createChildElement(J){let Q=J.createElement();return this.addChild(Q),Q.mount(),Q}deactivateChild(J){J.unmount(),this.removeChild(J)}performRebuild(){}}class oB extends vg{constructor(J){super(J)}get leafWidget(){return this.widget}performRebuild(){}}class k8 extends K7{child;onClick;onEnter;onExit;onHover;onScroll;onRelease;onDrag;cursor;opaque;constructor({key:J,child:Q,onClick:Y,onEnter:X,onExit:G,onHover:Z,onScroll:q,onRelease:V,onDrag:K,cursor:W,opaque:H=!0}){super({key:J});this.child=Q,this.onClick=Y??null,this.onEnter=X??null,this.onExit=G??null,this.onHover=Z??null,this.onScroll=q??null,this.onRelease=V??null,this.onDrag=K??null,this.cursor=W??null,this.opaque=H}createElement(){return new p96(this)}createRenderObject(){return new xZ({onClick:this.onClick,onEnter:this.onEnter,onExit:this.onExit,onHover:this.onHover,onScroll:this.onScroll,onRelease:this.onRelease,onDrag:this.onDrag,cursor:this.cursor,opaque:this.opaque})}updateRenderObject(J){J.onClick=this.onClick,J.onEnter=this.onEnter,J.onExit=this.onExit,J.onHover=this.onHover,J.onScroll=this.onScroll,J.onRelease=this.onRelease,J.onDrag=this.onDrag,J.cursor=this.cursor,J.opaque=this.opaque}}class p96 extends CK{get mouseRegionWidget(){return this.widget}get renderObject(){return super.renderObject}}class xZ extends v4{onClick;onEnter;onExit;onHover;onScroll;onRelease;onDrag;cursor;opaque;_isHovered=!1;constructor({onClick:J,onEnter:Q,onExit:Y,onHover:X,onScroll:G,onRelease:Z,onDrag:q,cursor:V,opaque:K}){super();this.onClick=J,this.onEnter=Q,this.onExit=Y,this.onHover=X,this.onScroll=G,this.onRelease=Z,this.onDrag=q,this.cursor=V,this.opaque=K}get hasMouseListeners(){return!!(this.onClick||this.onEnter||this.onExit||this.onHover||this.onScroll||this.onRelease||this.onDrag)}get isHovered(){return this._isHovered}handleMouseEvent(J){switch(J.type){case"click":this.onClick?.(J);break;case"enter":this._isHovered=!0,this.onEnter?.(J);break;case"exit":this._isHovered=!1,this.onExit?.(J);break;case"hover":this.onHover?.(J);break;case"scroll":this.onScroll?.(J);break;case"drag":this.onDrag?.(J);break;case"release":this.onRelease?.(J);break}}performLayout(){let J=this._lastConstraints;if(L4(!!J,"performLayout called without constraints"),this.children.length>0){let Q=this.children[0];Q.layout(J);let Y=Q.size;this.setSize(Y.width,Y.height),Q.setOffset(0,0)}else this.setSize(0,0);super.performLayout()}getMinIntrinsicHeight(J){if(this.children.length>0)return this.children[0].getMinIntrinsicHeight(J);return 0}getMaxIntrinsicHeight(J){if(this.children.length>0)return this.children[0].getMaxIntrinsicHeight(J);return 0}getMinIntrinsicWidth(J){if(this.children.length>0)return this.children[0].getMinIntrinsicWidth(J);return 0}getMaxIntrinsicWidth(J){if(this.children.length>0)return this.children[0].getMaxIntrinsicWidth(J);return 0}paint(J,Q=0,Y=0){if(this.children.length>0)this.children[0].paint(J,Q+this.offset.x,Y+this.offset.y)}hitTest(J,Q,Y=0,X=0){let G=super.hitTest(J,Q,Y,X);if(G&&this.hasMouseListeners)J.addMouseTarget(this,Q);return G}getDebugProperties(){return{hasMouseListeners:this.hasMouseListeners,isHovered:this.isHovered,cursor:this.cursor,opaque:this.opaque}}dispose(){k7.instance.removeRegion(this),this.onClick=null,this.onEnter=null,this.onExit=null,this.onHover=null,this.onScroll=null,this.onRelease=null,this.onDrag=null,this.cursor=null,super.dispose()}}class tR1{static hitTest(J,Q){let Y=new d96;return J.hitTest(Y,Q),Y}}class d96{_hits=[];get hits(){return this._hits}add(J){this._hits.push(J)}addWithPaintOffset(J,Q,Y){let X={x:Y.x-Q.x,y:Y.y-Q.y};this.add({target:J,localPosition:X})}addMouseTarget(J,Q){}}function Wq8(){if(!aB.prototype.hitTest)aB.prototype.hitTest=function(J,Q,Y=0,X=0){if("size"in this&&"offset"in this){let Z=this,q=Z.size,V=Z.offset;if(q&&V){let K=Y+V.x,W=X+V.y,H=Q.x>=K&&Q.x<K+q.width,z=Q.y>=W&&Q.y<W+q.height;if(H&&z){let U={x:Q.x-K,y:Q.y-W};J.add({target:this,localPosition:U});let N=this.children,M=!0;for(let L=N.length-1;L>=0;L--)if(N[L].hitTest(J,Q,K,W))M=!0;return M}if(this.allowHitTestOutsideBounds){let U=!1,N=this.children;for(let M=N.length-1;M>=0;M--)if(N[M].hitTest(J,Q,K,W))U=!0;return U}return!1}}let G=!1;for(let Z of this.children)if(Z.hitTest(J,Q,Y,X))G=!0;return G}}Wq8();function tR(J,Q,Y){return{position:Q,localPosition:Y,modifiers:{shift:J.modifiers.shift,ctrl:J.modifiers.ctrl,alt:J.modifiers.alt}}}function c96(J,Q,Y,X=1){return{type:"click",button:J.button==="left"?"left":J.button==="middle"?"middle":J.button==="right"?"right":"left",clickCount:X,...tR(J,Q,Y)}}function l96(J,Q,Y){return{type:"scroll",direction:J.button==="wheel_up"?"up":"down",...tR(J,Q,Y)}}class k7{static _instance=null;_rootRenderObject=null;_hoveredRegions=new Set;_vaxis=null;_currentCursor=l9.DEFAULT;_lastMousePosition=null;_dragTargets=[];_lastDragPosition=null;_globalReleaseCallbacks=new Set;_globalClickCallbacks=new Set;_lastClickTime=new Map;_lastClickPosition=new Map;_currentClickCount=new Map;static DOUBLE_CLICK_TIME=500;static DOUBLE_CLICK_DISTANCE=2;static DOUBLE_CLICK_DISTANCE_SQUARED=k7.DOUBLE_CLICK_DISTANCE*k7.DOUBLE_CLICK_DISTANCE;_scratchCurrentRegions=new Set;_scratchEnteredRegions=new Set;_scratchExitedRegions=new Set;constructor(){}static get instance(){if(!this._instance)this._instance=new k7;return this._instance}setRootRenderObject(J){this._rootRenderObject=J}setTui(J){this._vaxis=J}handleMouseEvent(J){if(!this._rootRenderObject)return;let Q={x:J.x,y:J.y},Y=tR1.hitTest(this._rootRenderObject,Q),X=this._findMouseTargets(Y.hits);switch(J.action){case"press":if(J.button==="left"||J.button==="middle"||J.button==="right"){if(this._handleClick(J,Q,X),J.button==="left"){this._dragTargets=[];for(let{target:G,localPosition:Z}of X){let q={x:Q.x-Z.x,y:Q.y-Z.y};if(this._dragTargets.push({target:G,localPosition:Z,globalOffset:q}),G instanceof xZ&&G.opaque)break}}}break;case"release":this._handleRelease(J,Q,X),this._dragTargets=[],this._lastDragPosition=null;break;case"scroll":if(J.button==="wheel_up"||J.button==="wheel_down")this._handleScroll(J,Q,X);break;case"move":if(this._handleMove(J,Q,X),J.drag)this._handleDrag(J,Q,X);break}this._lastMousePosition=Q}addGlobalReleaseCallback(J){this._globalReleaseCallbacks.add(J)}removeGlobalReleaseCallback(J){this._globalReleaseCallbacks.delete(J)}addGlobalClickCallback(J){this._globalClickCallbacks.add(J)}removeGlobalClickCallback(J){this._globalClickCallbacks.delete(J)}requestCursorChange(J){if(this._vaxis&&J!==this._currentCursor)this._currentCursor=J,this._vaxis.setMouseCursor(J)}_handleRelease(J,Q,Y){for(let G of this._globalReleaseCallbacks)G();let X=J.button==="left"||J.button==="middle"||J.button==="right"?J.button:"left";if(this._dragTargets.length>0)for(let{target:G,globalOffset:Z}of this._dragTargets){let q={x:Q.x-Z.x,y:Q.y-Z.y},V={type:"release",button:X,...tR(J,Q,q)};G.handleMouseEvent(V)}else for(let{target:G,localPosition:Z}of Y){let q={type:"release",button:X,...tR(J,Q,Z)};if(G.handleMouseEvent(q),G instanceof xZ&&G.opaque)break}}_handleDrag(J,Q,Y){let X=J.button==="left"||J.button==="middle"||J.button==="right"?J.button:"left",G=this._lastDragPosition?Q.x-this._lastDragPosition.x:0,Z=this._lastDragPosition?Q.y-this._lastDragPosition.y:0;for(let{target:q,globalOffset:V}of this._dragTargets){let K={x:Q.x-V.x,y:Q.y-V.y},W={type:"drag",button:X,deltaX:G,deltaY:Z,...tR(J,Q,K)};q.handleMouseEvent(W)}this._lastDragPosition=Q}_handleClick(J,Q,Y){let X=this._calculateClickCount(Q,J.button);for(let G of this._globalClickCallbacks)G({event:J,globalPosition:Q,mouseTargets:Y,clickCount:X});for(let{target:G,localPosition:Z}of Y){let q=c96(J,Q,Z,X);if(G.handleMouseEvent(q),G instanceof xZ&&G.opaque)break}}_handleScroll(J,Q,Y){for(let{target:X,localPosition:G}of Y){let Z=l96(J,Q,G);if(X.handleMouseEvent(Z),X instanceof xZ&&X.opaque)break}}_handleMove(J,Q,Y){let X=Y.filter((V)=>V.target instanceof xZ),G=this._scratchCurrentRegions,Z=this._scratchExitedRegions,q=this._scratchEnteredRegions;G.clear();for(let{target:V}of X)G.add(V);Z.clear();for(let V of this._hoveredRegions)if(!G.has(V))Z.add(V);q.clear();for(let V of G)if(!this._hoveredRegions.has(V))q.add(V);for(let V of Z)if(V.onExit){let K={type:"exit",position:Q,localPosition:Q,modifiers:{shift:J.modifiers.shift,ctrl:J.modifiers.ctrl,alt:J.modifiers.alt}};V.handleMouseEvent(K)}for(let{target:V,localPosition:K}of X)if(q.has(V)&&V.onEnter){let W={type:"enter",position:Q,localPosition:K,modifiers:{shift:J.modifiers.shift,ctrl:J.modifiers.ctrl,alt:J.modifiers.alt}};V.handleMouseEvent(W)}for(let{target:V,localPosition:K}of X)if(V.onHover&&this._hoveredRegions.has(V)){let W={type:"hover",position:Q,localPosition:K,modifiers:{shift:J.modifiers.shift,ctrl:J.modifiers.ctrl,alt:J.modifiers.alt}};V.handleMouseEvent(W)}this._hoveredRegions.clear();for(let V of G)this._hoveredRegions.add(V);this._updateCursor(X)}_updateCursor(J){if(!this._vaxis)return;let Q=l9.DEFAULT,Y=-1;for(let{target:X}of J){let G=X.depth;if(G<=Y)break;if(X.cursor!==null)Q=X.cursor;Y=G}if(Q!==this._currentCursor)this._currentCursor=Q,this._vaxis.setMouseCursor(Q)}_findMouseTargets(J){let Q=[];for(let Y of J)if(this._canHandleMouseEvents(Y.target))Q.push({target:Y.target,localPosition:Y.localPosition});return Q}_canHandleMouseEvents(J){if(J instanceof xZ)return!0;return typeof J.handleMouseEvent==="function"}clearHoverState(){if(this._hoveredRegions.clear(),this._dragTargets=[],this._vaxis&&this._currentCursor!==l9.DEFAULT)this._currentCursor=l9.DEFAULT,this._vaxis.setMouseCursor(l9.DEFAULT)}removeRegion(J){this._hoveredRegions.delete(J)}reestablishHoverState(){if(!this._lastMousePosition||!this._rootRenderObject)return;let J={type:"mouse",action:"move",x:this._lastMousePosition.x,y:this._lastMousePosition.y,button:"unknown",drag:!1,modifiers:{shift:!1,ctrl:!1,alt:!1,meta:!1}};this.handleMouseEvent(J)}_calculateClickCount(J,Q="left"){let Y=Date.now(),X=this._lastClickTime.get(Q)??0,G=Y-X,Z=1,q=this._lastClickPosition.get(Q);if(q&&G<=k7.DOUBLE_CLICK_TIME&&this._isWithinDoubleClickDistance(J,q))Z=(this._currentClickCount.get(Q)??0)+1;else Z=1;return this._lastClickTime.set(Q,Y),this._lastClickPosition.set(Q,J),this._currentClickCount.set(Q,Z),Z}_isWithinDoubleClickDistance(J,Q){let Y=J.x-Q.x,X=J.y-Q.y;return Y*Y+X*X<=k7.DOUBLE_CLICK_DISTANCE_SQUARED}dispose(){this.clearHoverState(),this._lastMousePosition=null,this._rootRenderObject=null,this._lastClickTime.clear(),this._lastClickPosition.clear(),this._currentClickCount.clear(),this._globalReleaseCallbacks.clear(),this._globalClickCallbacks.clear(),k7._instance=null}}class eR1{_nodesNeedingPaint=new Set;_rootRenderObject=null;_rootConstraints=null;constructor(){}requestLayout(J){if(!w9.instance.isFrameInProgress)w9.instance.requestFrame()}requestPaint(J){if(this._nodesNeedingPaint.has(J))return;if(this._nodesNeedingPaint.add(J),!w9.instance.isFrameInProgress)w9.instance.requestFrame()}setRootRenderObject(J){this._rootRenderObject=J}updateRootConstraints(J){let Q=new r6(0,J.width,0,J.height),Y=!this._rootConstraints||this._rootConstraints.maxWidth!==Q.maxWidth||this._rootConstraints.maxHeight!==Q.maxHeight;if(this._rootConstraints=Q,Y&&this._rootRenderObject&&"markNeedsLayout"in this._rootRenderObject)this._rootRenderObject.markNeedsLayout()}flushLayout(){if(this._rootRenderObject&&this._rootConstraints&&"needsLayout"in this._rootRenderObject&&this._rootRenderObject.needsLayout){if("layout"in this._rootRenderObject&&typeof this._rootRenderObject.layout==="function")this._rootRenderObject.layout(this._rootConstraints)}}flushPaint(){if(this._nodesNeedingPaint.size===0)return;try{for(let J of this._nodesNeedingPaint)if(J.needsPaint)J._needsPaint=!1}finally{this._nodesNeedingPaint.clear()}}get nodesNeedingLayout(){return[]}get nodesNeedingPaint(){return Array.from(this._nodesNeedingPaint)}get hasNodesNeedingLayout(){return!1}get hasNodesNeedingPaint(){return this._nodesNeedingPaint.size>0}dispose(){this._nodesNeedingPaint.clear()}removeFromQueues(J){this._nodesNeedingPaint.delete(J)}}class E9{static _instance;frameScheduler=w9.instance;buildOwner;pipelineOwner;focusManager=kZ.instance;mouseManager=k7.instance;frameStatsOverlay=new sR1;tui=new iR1;rootElement;isRunning=!1;rootElementMountedCallback;eventCallbacks={key:[],mouse:[],paste:[]};rgbColorChangeCallbacks=[];cachedRgbColors=null;static get instance(){return this._instance??=new E9}pendingResizeEvent=null;constructor(){this.buildOwner=new aR1,this.pipelineOwner=new eR1,this.frameScheduler.addFrameCallback("resize",()=>this.processResizeIfPending(),"build",-1000,"WidgetsBinding.processResizeIfPending"),this.frameScheduler.addFrameCallback("build",()=>this.buildOwner.buildScopes(),"build",0,"BuildOwner.buildScopes"),this.frameScheduler.addFrameCallback("layout",()=>{this.updateRootConstraints(),this.pipelineOwner.flushLayout()},"layout",0,"PipelineOwner.flushLayout"),this.frameScheduler.addFrameCallback("paint",()=>this.paint(),"paint",0,"WidgetsBinding.paint"),this.frameScheduler.addFrameCallback("render",()=>this.render(),"render",0,"WidgetsBinding.render"),h96({scheduleBuildFor:(J)=>this.buildOwner.scheduleBuildFor(J)},{requestLayout:(J)=>this.pipelineOwner.requestLayout(J),requestPaint:(J)=>this.pipelineOwner.requestPaint(J),removeFromQueues:(J)=>this.pipelineOwner.removeFromQueues(J)}),this.setupErrorHandler()}setupErrorHandler(){process.on("uncaughtException",(J)=>{f.error("Framework uncaught exception",J)})}getRgbColors(){return this.cachedRgbColors}onRgbColorsChanged(J){return this.rgbColorChangeCallbacks.push(J),()=>{let Q=this.rgbColorChangeCallbacks.indexOf(J);if(Q!==-1)this.rgbColorChangeCallbacks.splice(Q,1)}}notifyRgbColorsChanged(){for(let J of this.rgbColorChangeCallbacks)J()}updateRgbColors(J){this.cachedRgbColors=J;let Q=this.tui.getScreen();Q.setDefaultColors({type:"rgb",value:J.bg},{type:"rgb",value:J.fg}),Q.setIndexRgbMapping(J.indices),this.notifyRgbColorsChanged(),this.frameScheduler.requestFrame()}async runApp(J){if(this.isRunning)throw Error("App is already running");try{this.isRunning=!0,this.tui.init(),this.tui.enterAltScreen();let{initFocusTracking:Q}=await Promise.resolve().then(() => i96);Q(this.tui);let{initIdleTracking:Y}=await Promise.resolve().then(() => (XC1(),a96));Y(this.tui),await this.tui.waitForCapabilities(1000);let X=this.tui.getQueryParser(),G=X?.getRgbColors();if(f.info("Initial RGB colors from terminal",{available:!!G}),G)this.updateRgbColors(G);if(X)X.setColorPaletteChangeCallback(()=>{let V=X.getRgbColors();if(V)this.updateRgbColors(V)});let Z=this.createMediaQueryWrapper(J);if(this.rootElement=Z.createElement(),this.rootElement.mount(),this.rootElementMountedCallback)this.rootElementMountedCallback(this.rootElement);let q=this.rootElement.renderObject;if(!q&&this.rootElement.children.length>0)q=this.rootElement.children[0]?.renderObject;if(q)this.pipelineOwner.setRootRenderObject(q),this.updateRootConstraints();if(this.rootElement.renderObject)this.mouseManager.setRootRenderObject(this.rootElement.renderObject);this.mouseManager.setTui(this.tui),f.debug("Setting up event handlers..."),this.setupEventHandlers(),f.debug("Requesting initial frame..."),this.frameScheduler.requestFrame(),f.debug("Waiting for exit...",{isRunning:this.isRunning}),await this.waitForExit(),f.debug("waitForExit completed")}finally{f.debug("Cleaning up..."),await this.cleanup()}}stop(){if(this.isRunning=!1,this.exitResolve)this.exitResolve(),this.exitResolve=null}updateRootConstraints(){let J=this.tui.getSize();this.pipelineOwner.updateRootConstraints(J)}processResizeIfPending(){if(!this.pendingResizeEvent)return;let J=this.pendingResizeEvent;if(this.pendingResizeEvent=null,this.rootElement){let Q={width:J.width,height:J.height},Y=this.tui.getCapabilities()||jg(),X=new rR(Q,Y),G=this.rootElement;if(G.widget instanceof U8){let q=new U8({data:X,child:G.widget.child});G.update(q)}this.tui.getScreen().markForRefresh(),this.pipelineOwner.updateRootConstraints(Q),this.rootElement.markNeedsRebuild(),this.frameScheduler.requestFrame(),this.frameScheduler.addPostFrameCallback(()=>{this.mouseManager.reestablishHoverState()},"MouseManager.reestablishHoverState")}}paint(){if(this.pipelineOwner.flushPaint(),!this.rootElement)return;let J=this.rootElement.renderObject;if(!J&&this.rootElement.children.length>0)J=this.rootElement.children[0]?.renderObject;if(!J)return;try{let Q=this.tui.getScreen();Q.clear(),Q.clearCursor(),this.renderRenderObject(J,Q,0,0);let Y=this.frameScheduler.frameStats;this.frameStatsOverlay.recordStats(Y),this.frameStatsOverlay.draw(Q,Y)}catch(Q){f.error("Paint error:",Q)}}render(){try{this.tui.render()}catch(J){f.error("Render error:",J)}}renderRenderObject(J,Q,Y,X){if("paint"in J&&typeof J.paint==="function")J.paint(Q,Y,X)}createMediaQueryWrapper(J){let Q=this.tui.getCapabilities()||jg(),Y=this.tui.getSize(),X=new rR(Y,Q);return new U8({data:X,child:J})}setupEventHandlers(){this.tui.onResize((J)=>{this.mouseManager.clearHoverState(),this.pendingResizeEvent=J,this.frameScheduler.requestFrame()}),this.tui.onKey((J)=>{let Q=performance.now();for(let G of this.eventCallbacks.key)G(J);if(this.focusManager.handleKeyEvent(J)){let G=performance.now()-Q;this.frameStatsOverlay.recordKeyEvent(G);return}this.handleGlobalKeyEvent(J);let X=performance.now()-Q;this.frameStatsOverlay.recordKeyEvent(X)}),this.tui.onMouse((J)=>{let Q=performance.now();for(let X of this.eventCallbacks.mouse)X(J);this.mouseManager.handleMouseEvent(J);let Y=performance.now()-Q;this.frameStatsOverlay.recordMouseEvent(Y)}),this.tui.onPaste((J)=>{for(let Q of this.eventCallbacks.paste)Q(J);this.focusManager.handlePasteEvent(J)}),this.tui.onCapabilities((J)=>{if(this.rootElement){let Q=this.tui.getSize(),Y=new rR(Q,J.capabilities),X=this.rootElement;if(X.widget instanceof U8){let G=new U8({data:Y,child:X.widget.child});X.update(G)}this.rootElement.markNeedsRebuild(),this.frameScheduler.requestFrame()}})}handleGlobalKeyEvent(J){if(J.ctrlKey&&J.key==="z"&&!J.shiftKey&&!J.altKey&&!J.metaKey){this.tui.handleSuspend();return}}toggleFrameStatsOverlay(){let J=!this.frameStatsOverlay.isEnabled();this.frameStatsOverlay.setEnabled(J),this.frameScheduler.requestFrame()}exitPromise=null;exitResolve=null;async waitForExit(){if(this.exitPromise)return this.exitPromise;return this.exitPromise=new Promise((J)=>{if(this.exitResolve=J,!this.isRunning)J()}),this.exitPromise}async cleanup(){if(this.isRunning=!1,this.rootElement)this.rootElement.unmount(),this.rootElement=void 0;this.buildOwner.dispose(),this.pipelineOwner.dispose(),this.focusManager.dispose(),this.mouseManager.dispose(),this.frameScheduler.removeFrameCallback("resize"),this.frameScheduler.removeFrameCallback("build"),this.frameScheduler.removeFrameCallback("layout"),this.frameScheduler.removeFrameCallback("paint"),this.frameScheduler.removeFrameCallback("render"),await this.tui.deinit()}get tuiInstance(){return this.tui}get rootElementInstance(){return this.rootElement}setRootElementMountedCallback(J){this.rootElementMountedCallback=J}on(J,Q){let Y=this.eventCallbacks[J];return Y.push(Q),()=>{let X=Y.indexOf(Q);if(X!==-1)Y.splice(X,1)}}}async function GC1(J,Q){let Y=E9.instance;if(Q?.onRootElementMounted)Y.setRootElementMountedCallback(Q.onRootElementMounted);await Y.runApp(J)}class ZC1{async runInTerminal(J,Q){let X=E9.instance.tuiInstance;if(X.isInitialized()&&!X.isSuspended())X.suspend();try{await new Promise((G,Z)=>{let q=Uq8(J,{shell:!0,cwd:Q,stdio:"inherit"});q.on("exit",(V)=>{if(V===0)G();else Z(Error(`Command failed with exit code ${V}`))}),q.on("error",(V)=>{Z(V)})})}finally{if(X.isInitialized())X.resume()}}}_W();import*as U56 from"node:path";o0();import{Console as Bq8}from"node:console";var Nq8=(J)=>J.json?Dq8(J):Mq8(J),o96=(J)=>{if(!J)return"";let Q=J.match(/[.;:\n]/);if(Q)return J.slice(0,Q.index);return J},r96=(J)=>{if(J==="builtin")return"built-in";if(typeof J==="object"&&"toolbox"in J)return"toolbox";if(typeof J==="object"&&"mcp"in J)return"local-mcp";if(typeof J==="object"&&"remote"in J)return J.remote;return"unknown"},Dq8=(J)=>(Q)=>{let Y=Q.map((G)=>({name:G.spec.name,source:r96(G.spec.source),description:o96(G.spec.description)})),X=J.isTTY?JSON.stringify(Y,null,2):JSON.stringify(Y);J.stdout.write(X)},Mq8=(J)=>(Q)=>{let Y=Q.map(({spec:H})=>({name:H.name,source:r96(H.source),description:o96(H.description)})),X=new Bq8(J.stdout),G=Y.filter((H)=>H.source==="built-in"),Z=Y.filter((H)=>H.source==="local-mcp"),q=Y.filter((H)=>!["built-in","local-mcp"].includes(H.source)),V=Math.max(...Y.map((H)=>H.name.length)),K=Math.max(...Y.map((H)=>H.source.length)),W=(H)=>X.log(H.name.padEnd(V),H.source.padEnd(K),H.description);G.forEach(W),Z.forEach(W),q.forEach(W)};async function s96(J){await J.mcpService.initialized;let Q=await M6(J.mcpService.servers);for(let G of Q)if(G.status.type==="connection-failed")J.stderr.write(`error connecting to ${G.name}: ${G.status.error.message||"Unknown error"}
|
|
4370
|
-
`);let Y=await M6(J.toolService.
|
|
4370
|
+
`);let Y=await M6(J.toolService.getToolsForMode(J.mode));Nq8(J)(Y),J.exit(0)}import*as t96 from"node:fs";import{join as Lq8}from"node:path";b7();H4();var e96={...U5,async chmod(J,Q){await t96.promises.chmod(o4(J).fsPath,Q);return}};async function J56(J){if(!Rk.test(J.toolName)){J.stdout.write(K$1(J.toolName)+`
|
|
4371
4371
|
`),J.exit(1);return}let Q=n0.file(J.toolboxDir);await J.fs.mkdirp(Q);let Y=Lq8(J.toolboxDir,J.toolName),X=n0.file(Y);if(!J.force)try{await J.fs.stat(X);let Z=await J.fs.realpath(X);J.stdout.write([`Error: a tool named ${J.toolName} already exists at ${Z.fsPath}.`,"Use --force to overwrite."].join(`
|
|
4372
4372
|
`)+`
|
|
4373
4373
|
`),J.exit(1);return}catch(Z){}let G=Aq8(J.toolName,J.language||"bun");await J.fs.writeFile(X,G),await J.fs.chmod(X,493),J.stdout.write([`Tool created at: ${Y}`,"",`Inspect with: amp tools show tb__${J.toolName}`,"",`Execute with: amp tools use tb__${J.toolName}`].join(`
|
|
@@ -4606,7 +4606,7 @@ function execute() {
|
|
|
4606
4606
|
`)}function iq8(J,Q,Y){try{let G=new W56.default({allErrors:!0}).compile(Q);if(G(J))return null;let q=G.errors||[];if(q.length===0)return`Invalid input for tool '${Y}'`;let V=q.filter((z)=>z.keyword==="required"),K=q.filter((z)=>z.keyword==="type"),W=q.filter((z)=>!["required","type"].includes(z.keyword)),H=[];if(V.length>0){let z=V.map((U)=>{let N=U.params?.missingProperty;return N?`--${N}`:"unknown parameter"});H.push(`Missing required ${Z5(z.length,"parameter")}: ${z.join(", ")}`)}for(let z of K){let U=z.instancePath?z.instancePath.replace(/^\//,""):"unknown",N=U?`--${U}`:"parameter",M=z.params?.type||"unknown";H.push(`Parameter ${N} must be of type ${M}`)}for(let z of W){let U=z.instancePath?z.instancePath.replace(/^\//,""):"unknown",N=U?`--${U}`:"parameter";H.push(`Parameter ${N}: ${z.message}`)}if(Q?.properties&&Object.keys(Q.properties).length>0)H.push(`
|
|
4607
4607
|
Available parameters:`),H.push(lq8(Q));return H.join(`
|
|
4608
4608
|
`)}catch(X){return`Failed to validate input for tool '${Y}': ${X instanceof Error?X.message:"Unknown validation error"}`}}function F56(){return!process.stdin.isTTY&&process.stdin.readable}function nq8(J){let Q={};for(let Y=0;Y<J.length;Y++){let X=J[Y];if(X&&X.startsWith("--")){let G=X.slice(2),Z=J[Y+1];if(Z&&!Z.startsWith("--")){if(Q[G])if(Array.isArray(Q[G]))Q[G].push(Z);else Q[G]=[Q[G],Z];else Q[G]=Z;Y++}}}return Q}function aq8(){let J=process.env.AMP_TOOLBOX;if(!J)return BE;let Q=J.split(":").map((X)=>X.trim()).filter(Boolean),Y=Q.filter((X)=>!U56.isAbsolute(X));if(Y.length>0)throw Error(`AMP_TOOLBOX must contain absolute paths only. Found relative paths: ${Y.join(", ")}
|
|
4609
|
-
See https://ampcode.com/manual#toolboxes`);return Q[0]||BE}function B56(J,Q){let Y=J.command("tools").alias("tool").description("Tool management commands");return oq8(Y,Q),rq8(Y,Q),sq8(Y,Q),tq8(Y,Q),Y}function oq8(J,Q){J.command("list").alias("ls").description("List all active tools (including MCP tools)").option("--json","output as a single JSON array").action(async function(Y,X){let G=X.optsWithGlobals(),Z=await Q(X,G),q=0;await s96({json:G.json,isTTY:Z.context.isTTY,toolService:Z.toolService,configService:Z.configService,mcpService:Z.mcpService,stderr:process.stderr,stdout:process.stdout,exit:(V)=>{q=V}}),await Z.asyncDispose(),Z.cleanupTerminal(),process.exit(q)})}function rq8(J,Q){J.command("show").argument("<tool>","The tool for which to show details").description("Show details about an active tool").option("--json","output as a single JSON object").action(async function(Y,X,G){let Z=G.optsWithGlobals(),q=await Q(G,Z),V=0,K=q.toolService;await Q56({toolName:Y,json:Z.json,isTTY:q.context.isTTY,toolService:K,stdout:process.stdout,exit:(W)=>{V=W}}),await q.asyncDispose(),q.cleanupTerminal(),process.exit(V)})}function sq8(J,Q){J.command("make").argument("<tool-name>","A descriptive name like run-tests or build-project").description("Sets up a skeleton tool in your toolbox").option("--force","Overwrite an existing tool if it already exists").option("--bun","Create a Bun/TypeScript tool (default)").option("--zsh","Create a Zsh shell script tool").option("--bash","Create a Bash shell script tool").action(async function(Y,X,G){let Z="bun";if(X.zsh)Z="zsh";else if(X.bash)Z="bash";else if(X.bun)Z="bun";try{let q=aq8();await J56({fs:e96,toolName:Y,toolboxDir:q,force:X.force,language:Z,stdout:process.stdout,exit:process.exit})}catch(q){process.stdout.write(`${q instanceof Error?q.message:String(q)}
|
|
4609
|
+
See https://ampcode.com/manual#toolboxes`);return Q[0]||BE}function B56(J,Q){let Y=J.command("tools").alias("tool").description("Tool management commands");return oq8(Y,Q),rq8(Y,Q),sq8(Y,Q),tq8(Y,Q),Y}function oq8(J,Q){J.command("list").alias("ls").description("List all active tools (including MCP tools)").option("--json","output as a single JSON array").option("--mode <mode>","filter tools by agent mode (default: smart)","smart").action(async function(Y,X){let G=X.optsWithGlobals(),Z=await Q(X,G),q=0;await s96({json:G.json,isTTY:Z.context.isTTY,mode:G.mode,toolService:Z.toolService,configService:Z.configService,mcpService:Z.mcpService,stderr:process.stderr,stdout:process.stdout,exit:(V)=>{q=V}}),await Z.asyncDispose(),Z.cleanupTerminal(),process.exit(q)})}function rq8(J,Q){J.command("show").argument("<tool>","The tool for which to show details").description("Show details about an active tool").option("--json","output as a single JSON object").action(async function(Y,X,G){let Z=G.optsWithGlobals(),q=await Q(G,Z),V=0,K=q.toolService;await Q56({toolName:Y,json:Z.json,isTTY:q.context.isTTY,toolService:K,stdout:process.stdout,exit:(W)=>{V=W}}),await q.asyncDispose(),q.cleanupTerminal(),process.exit(V)})}function sq8(J,Q){J.command("make").argument("<tool-name>","A descriptive name like run-tests or build-project").description("Sets up a skeleton tool in your toolbox").option("--force","Overwrite an existing tool if it already exists").option("--bun","Create a Bun/TypeScript tool (default)").option("--zsh","Create a Zsh shell script tool").option("--bash","Create a Bash shell script tool").action(async function(Y,X,G){let Z="bun";if(X.zsh)Z="zsh";else if(X.bash)Z="bash";else if(X.bun)Z="bun";try{let q=aq8();await J56({fs:e96,toolName:Y,toolboxDir:q,force:X.force,language:Z,stdout:process.stdout,exit:process.exit})}catch(q){process.stdout.write(`${q instanceof Error?q.message:String(q)}
|
|
4610
4610
|
`),process.exit(1)}})}function tq8(J,Q){let Y=[h4.bold("Examples:"),""," # invoke the Read tool for README.md and the first ten lines"," amp tools use Read --path $PWD/README.md --read_range 0 --read_range 10",""," # invoke web_search with JSON input",` amp tools use web_search <<<'{"query":"Svelte 5"}'`,""," # invoke a toolbox tool"," amp tools use tb__run_test --workspace server","",`Use ${h4.green("amp tools list")} to get a list of all tools available in this environment.`,"",`Use ${h4.green("amp tools show <tool-name>")} to see the schema of a tool.`].join(`
|
|
4611
4611
|
`);J.command("use").argument("<tool-name>","The tool to invoke").summary("Invoke a tool with arguments or JSON input from stdin").description(Y).option("--only <field>","Extract only the specified field from the result").option("--stream","Stream updates as they arrive instead of waiting for completion").allowUnknownOption(!0).allowExcessArguments(!0).action(async function(X,G,Z){let q=Z.optsWithGlobals(),V=await Q(Z,q),K=0,W=Z.args.slice(1),H;if(F56()){let z=[];for await(let U of process.stdin)z.push(U);H=Buffer.concat(z).toString("utf-8").trim()}await H56({toolName:X,rawArgs:W,stdinInput:H,only:G.only,stream:G.stream,threadDeps:V,stdout:process.stdout,stderr:process.stderr,exit:(z)=>{K=z}}),await V.asyncDispose(),V.cleanupTerminal(),process.exit(K)})}import{execFile as YD8}from"node:child_process";import{randomBytes as XD8}from"node:crypto";import{homedir as GD8}from"node:os";import Pm from"node:path";o0();L0();var N56=120000,D56=180000;function VC1(J,Q=Date.now()){return Q-J<D56}function KC1(J,Q,Y=()=>!0,X){let G=null,Z=[],q=5;return kW(X0.of(void 0),Nl(N56).pipe(R7(()=>Y()))).pipe(r4(()=>e6(async(V)=>{let K=await X?.getContext();f.debug("[Ads] Fetching ad from server",{hasContext:!!K});let W=await J.getCurrentAd({context:K,excludeAdIds:Z},{config:Q,signal:V});if(!W.ok)throw f.error("[Ads] Failed to fetch ad",{error:W.error.message}),Error(W.error.message);if(W.result){if(G=W.result,Z.length>=q)Z.shift();Z.push(G.id),f.debug("[Ads] Received ad from server",{adTitle:G.title,matchType:G.metadata?.matchType,matchedPatterns:G.metadata?.matchedPatterns,candidateAdPoolCount:G.metadata?.candidateAdPoolCount,recentlyShownCount:Z.length})}else f.debug("[Ads] No ad available from server");return G})),x4((V,K)=>V?.id===K?.id))}L0();TY();C$();g7();function eq8(J){let Q=J.artifacts?.plan;if(Q&&Q.type==="plan")return Q;return}function iA(J){let Q=eq8(J);if(!Q)return!1;let Y=Q.content;return Y.trim()!==""&&Y!==p$}ZZ();o0();var WC1,JV8=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),M56=(WC1=String.fromCodePoint)!==null&&WC1!==void 0?WC1:(J)=>{let Q="";if(J>65535)J-=65536,Q+=String.fromCharCode(J>>>10&1023|55296),J=56320|J&1023;return Q+=String.fromCharCode(J),Q};function L56(J){var Q;if(J>=55296&&J<=57343||J>1114111)return 65533;return(Q=JV8.get(J))!==null&&Q!==void 0?Q:J}function e61(J){let Q=typeof atob==="function"?atob(J):typeof Buffer.from==="function"?Buffer.from(J,"base64").toString("binary"):new Buffer(J,"base64").toString("binary"),Y=Q.length&-2,X=new Uint16Array(Y/2);for(let G=0,Z=0;G<Y;G+=2){let q=Q.charCodeAt(G),V=Q.charCodeAt(G+1);X[Z++]=q|V<<8}return X}var A56=e61("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWm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agAAoAwg");var O56=e61("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg");var $Q;(function(J){J[J.VALUE_LENGTH=49152]="VALUE_LENGTH",J[J.FLAG13=8192]="FLAG13",J[J.BRANCH_LENGTH=8064]="BRANCH_LENGTH",J[J.JUMP_TABLE=127]="JUMP_TABLE"})($Q||($Q={}));var y7;(function(J){J[J.NUM=35]="NUM",J[J.SEMI=59]="SEMI",J[J.EQUALS=61]="EQUALS",J[J.ZERO=48]="ZERO",J[J.NINE=57]="NINE",J[J.LOWER_A=97]="LOWER_A",J[J.LOWER_F=102]="LOWER_F",J[J.LOWER_X=120]="LOWER_X",J[J.LOWER_Z=122]="LOWER_Z",J[J.UPPER_A=65]="UPPER_A",J[J.UPPER_F=70]="UPPER_F",J[J.UPPER_Z=90]="UPPER_Z"})(y7||(y7={}));var w56=32;function HC1(J){return J>=y7.ZERO&&J<=y7.NINE}function QV8(J){return J>=y7.UPPER_A&&J<=y7.UPPER_F||J>=y7.LOWER_A&&J<=y7.LOWER_F}function YV8(J){return J>=y7.UPPER_A&&J<=y7.UPPER_Z||J>=y7.LOWER_A&&J<=y7.LOWER_Z||HC1(J)}function XV8(J){return J===y7.EQUALS||YV8(J)}var m3;(function(J){J[J.EntityStart=0]="EntityStart",J[J.NumericStart=1]="NumericStart",J[J.NumericDecimal=2]="NumericDecimal",J[J.NumericHex=3]="NumericHex",J[J.NamedEntity=4]="NamedEntity"})(m3||(m3={}));var jK;(function(J){J[J.Legacy=0]="Legacy",J[J.Strict=1]="Strict",J[J.Attribute=2]="Attribute"})(jK||(jK={}));class zC1{constructor(J,Q,Y){this.decodeTree=J,this.emitCodePoint=Q,this.errors=Y,this.state=m3.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=jK.Strict}startEntity(J){this.decodeMode=J,this.state=m3.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(J,Q){switch(this.state){case m3.EntityStart:{if(J.charCodeAt(Q)===y7.NUM)return this.state=m3.NumericStart,this.consumed+=1,this.stateNumericStart(J,Q+1);return this.state=m3.NamedEntity,this.stateNamedEntity(J,Q)}case m3.NumericStart:return this.stateNumericStart(J,Q);case m3.NumericDecimal:return this.stateNumericDecimal(J,Q);case m3.NumericHex:return this.stateNumericHex(J,Q);case m3.NamedEntity:return this.stateNamedEntity(J,Q)}}stateNumericStart(J,Q){if(Q>=J.length)return-1;if((J.charCodeAt(Q)|w56)===y7.LOWER_X)return this.state=m3.NumericHex,this.consumed+=1,this.stateNumericHex(J,Q+1);return this.state=m3.NumericDecimal,this.stateNumericDecimal(J,Q)}stateNumericHex(J,Q){while(Q<J.length){let Y=J.charCodeAt(Q);if(HC1(Y)||QV8(Y)){let X=Y<=y7.NINE?Y-y7.ZERO:(Y|w56)-y7.LOWER_A+10;this.result=this.result*16+X,this.consumed++,Q++}else return this.emitNumericEntity(Y,3)}return-1}stateNumericDecimal(J,Q){while(Q<J.length){let Y=J.charCodeAt(Q);if(HC1(Y))this.result=this.result*10+(Y-y7.ZERO),this.consumed++,Q++;else return this.emitNumericEntity(Y,2)}return-1}emitNumericEntity(J,Q){var Y;if(this.consumed<=Q)return(Y=this.errors)===null||Y===void 0||Y.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(J===y7.SEMI)this.consumed+=1;else if(this.decodeMode===jK.Strict)return 0;if(this.emitCodePoint(L56(this.result),this.consumed),this.errors){if(J!==y7.SEMI)this.errors.missingSemicolonAfterCharacterReference();this.errors.validateNumericCharacterReference(this.result)}return this.consumed}stateNamedEntity(J,Q){let{decodeTree:Y}=this,X=Y[this.treeIndex],G=(X&$Q.VALUE_LENGTH)>>14;while(Q<J.length){if(G===0&&(X&$Q.FLAG13)!==0){let q=(X&$Q.BRANCH_LENGTH)>>7,V=X&$Q.JUMP_TABLE;if(Q+q>J.length)return-1;if(J.charCodeAt(Q)!==V)return this.result===0?0:this.emitNotTerminatedNamedEntity();Q++,this.excess++;let K=q-1;for(let W=1;W<q;W+=2){let H=Y[this.treeIndex+1+(W-1>>1)],z=H&255;if(J.charCodeAt(Q)!==z)return this.result===0?0:this.emitNotTerminatedNamedEntity();Q++,this.excess++;let U=H>>8&255;if(W+1<q){if(J.charCodeAt(Q)!==U)return this.result===0?0:this.emitNotTerminatedNamedEntity();Q++,this.excess++}}this.treeIndex+=1+(K+1>>1),X=Y[this.treeIndex],G=(X&$Q.VALUE_LENGTH)>>14}if(Q>=J.length)break;let Z=J.charCodeAt(Q);if(Z===y7.SEMI&&G!==0&&(X&$Q.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,G,this.consumed+this.excess);if(this.treeIndex=GV8(Y,X,this.treeIndex+Math.max(1,G),Z),this.treeIndex<0)return this.result===0||this.decodeMode===jK.Attribute&&(G===0||XV8(Z))?0:this.emitNotTerminatedNamedEntity();if(X=Y[this.treeIndex],G=(X&$Q.VALUE_LENGTH)>>14,G!==0){if(Z===y7.SEMI)return this.emitNamedEntityData(this.treeIndex,G,this.consumed+this.excess);if(this.decodeMode!==jK.Strict&&(X&$Q.FLAG13)===0)this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0}Q++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var J;let{result:Q,decodeTree:Y}=this,X=(Y[Q]&$Q.VALUE_LENGTH)>>14;return this.emitNamedEntityData(Q,X,this.consumed),(J=this.errors)===null||J===void 0||J.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(J,Q,Y){let{decodeTree:X}=this;if(this.emitCodePoint(Q===1?X[J]&~($Q.VALUE_LENGTH|$Q.FLAG13):X[J+1],Y),Q===3)this.emitCodePoint(X[J+2],Y);return Y}end(){var J;switch(this.state){case m3.NamedEntity:return this.result!==0&&(this.decodeMode!==jK.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case m3.NumericDecimal:return this.emitNumericEntity(0,2);case m3.NumericHex:return this.emitNumericEntity(0,3);case m3.NumericStart:return(J=this.errors)===null||J===void 0||J.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case m3.EntityStart:return 0}}}function E56(J){let Q="",Y=new zC1(J,(X)=>Q+=M56(X));return function(G,Z){let q=0,V=0;while((V=G.indexOf("&",V))>=0){Q+=G.slice(q,V),Y.startEntity(Z);let W=Y.write(G,V+1);if(W<0){q=V+Y.end();break}q=V+W,V=W===0?q+1:q}let K=Q+G.slice(q);return Q="",K}}function GV8(J,Q,Y,X){let G=(Q&$Q.BRANCH_LENGTH)>>7,Z=Q&$Q.JUMP_TABLE;if(G===0)return Z!==0&&X===Z?Y:-1;if(Z){let W=X-Z;return W<0||W>=G?-1:J[Y+W]-1}let q=G+1>>1,V=0,K=G-1;while(V<=K){let W=V+K>>>1,H=W>>1,U=J[Y+H]>>(W&1)*8&255;if(U<X)V=W+1;else if(U>X)K=W-1;else return J[Y+q+W]}return-1}var ZV8=E56(A56),$V8=E56(O56);function hg(J,Q=jK.Legacy){return ZV8(J,Q)}function J41(J){return $V8(J,jK.Strict)}var I56;(function(J){J[J.XML=0]="XML",J[J.HTML=1]="HTML"})(I56||(I56={}));var P56;(function(J){J[J.UTF8=0]="UTF8",J[J.ASCII=1]="ASCII",J[J.Extensive=2]="Extensive",J[J.Attribute=3]="Attribute",J[J.Text=4]="Text"})(P56||(P56={}));var eX=(J)=>{return J!=null},O0=(J)=>{return J!=null&&typeof J==="object"&&!Array.isArray(J)&&J.constructor===Object},qV8=/^\p{White_Space}*$/u,qQ=(J)=>{return typeof J==="string"&&J!==""&&!qV8.test(J)},nA=(J)=>{return typeof J==="number"||qQ(J)},_1=(J)=>{return J?.["#text"]??J},a7=(J,Q)=>{if(O0(J)){let Y=Q(J["@rdf:resource"]);if(eX(Y))return Y;let X=Q(J["@resource"]);if(eX(X))return X}return Q(_1(J))},N0=(J)=>{let Q;for(let Y in J){let X=J[Y];if(eX(X)){if(!Q)Q={};Q[Y]=X}}return Q},bg=(J,Q)=>{if(!Array.isArray(J)||J.length===0)return;if(!Q){let X=!1;for(let G=0;G<J.length;G++)if(!eX(J[G])){X=!0;break}if(!X)return J}let Y=[];for(let X=0;X<J.length;X++){let G=Q?Q(J[X]):J[X];if(eX(G))Y.push(G)}return Y.length>0?Y:void 0};var FC1="<![CDATA[",VV8="]]>",KV8=(J)=>{if(typeof J!=="string")return J;let Q=J.indexOf(FC1);if(Q===-1)return J;let Y="",X=0;while(Q!==-1){if(Y+=J.substring(X,Q),X=J.indexOf(VV8,Q+9),X===-1)return J;Y+=J.substring(Q+9,X),X+=3,Q=J.indexOf(FC1,X)}return Y+=J.substring(X),Y},R56=(J)=>{let Q=J.indexOf("&");return Q!==-1&&J.indexOf(";",Q)!==-1},$1=(J)=>{if(typeof J==="string"){if(J==="")return;let Q=J;if(J.indexOf(FC1)!==-1)Q=KV8(J);if(Q=Q.trim(),Q==="")return;if(R56(Q)){if(Q=J41(Q),R56(Q))Q=hg(Q)}return Q||void 0}if(typeof J==="number")return J.toString()},C6=(J)=>{if(typeof J==="number")return J;if(qQ(J)){let Q=+J;return Number.isNaN(Q)?void 0:Q}},WV8=/^\p{White_Space}*true\p{White_Space}*$/iu,HV8=/^\p{White_Space}*false\p{White_Space}*$/iu,zV8=/^\p{White_Space}*yes\p{White_Space}*$/iu,DJ=(J)=>{if(typeof J==="boolean")return J;if(qQ(J)){if(WV8.test(J))return!0;if(HV8.test(J))return!1}},VQ=(J)=>{let Q=DJ(J);if(Q!==void 0)return Q;if(qQ(J))return zV8.test(J)},n8=(J)=>{return $1(J)},FV8=(J)=>{if(Array.isArray(J))return J;if(!O0(J))return;if(J.length)return Array.from(J);let Q=Object.keys(J);if(Q.length===0)return;for(let Y=0;Y<Q.length;Y++){let X=Q[Y],G=Number(X);if(!Number.isInteger(G)||G!==Y)return}return Object.values(J)},v0=(J,Q,Y)=>{let X=FV8(J);if(!X&&eX(J))X=[J];if(X)return bg(UV8(X,Y),Q)},UV8=(J,Q)=>{if(Q===void 0||Q<0)return J;if(Q===0)return[];return J.slice(0,Q)},UC1=(J)=>{return Array.isArray(J)?J[0]:J},M1=(J,Q)=>{return Q(UC1(J))},rB=(J,Q)=>{if(!nA(J))return;let Y=$1(J)?.split(",");if(Y)return bg(Y,Q)};var wq=(J,Q=!1)=>{let Y=new Set,X=new Set,G=(Z)=>{if(Array.isArray(Z)){for(let q of Z)G(q);return}if(O0(Z))for(let q in Z){if(X.has(q))continue;X.add(q);let V=q.charCodeAt(0)===64?q.slice(1):q,K=V.indexOf(":");if(K>0)Y.add(V.slice(0,K));if(Q)G(Z[q])}};return G(J),Y};var JC=(J,Q,Y)=>{let X=(z)=>{return typeof z==="string"?z.trim().toLowerCase():z},G=Y&&J[Y]?J[Y].map(X):void 0,Z=(z,U,N)=>{let M=X(z);if(G?.includes(M))return U;let L=Q[M];if(L)return`${L}:${U}`;return N},q=(z)=>{let U={};if(O0(z)){for(let N in z)if(N==="@xmlns")U[""]=X(z[N]);else if(N.indexOf("@xmlns:")===0){let M=N.substring(7);U[M]=X(z[N])}}return U},V=(z,U,N=!1)=>{let M=z.indexOf(":");if(M===-1){if(N&&U[""])return Z(U[""],z,z);return z}let L=z.substring(0,M),A=z.substring(M+1),E=U[L];if(E)return Z(E,A,z);return z},K=(z,U)=>{if(z.charCodeAt(0)===64)return`@${V(z.substring(1),U,!1)}`;return V(z,U,!0)},W=(z,U={})=>{if(!O0(z))return z;if(Array.isArray(z))return z.map((E)=>W(E,U));let N={},M=new Map,L=q(z),A={...U,...L};for(let E in z){let P=z[E];if(E.indexOf("@xmlns")===0){N[E]=P;continue}let I=K(E,A),R=W(P,A);if(!M.has(I))M.set(I,[]);let S=M.get(I);if(S)S.push(R)}for(let[E,P]of M)N[E]=P.length===1?P[0]:P;return N},H=(z)=>{if(!O0(z))return z;if(Array.isArray(z))return z.map(H);let U={};for(let N in z){let M=z[N],L=q(M),A=Object.keys(L).length?K(N,L):N;U[A]=W(M)}return U};return H},QC=(J)=>{if(O0(J))return J;if(!qQ(J)||J.length<2)return;let Q=J.charAt(0)==="{"||/^\s*\{/.test(J),Y=J.charAt(J.length-1)==="}"||/\}\s*$/.test(J);if(!Q||!Y)return;try{return JSON.parse(J)}catch{}};var Q41=(J)=>{if(!qQ(J))return!1;if(!/(?:^|[\s>])<(?:\w+:)?feed[\s>]/im.test(J))return!1;let Q=J.includes("http://www.w3.org/2005/Atom"),Y=/(<(?:\w+:)?(entry|title|link|id|updated|summary)[\s>])/i.test(J);return Q||Y};var YC={trimValues:!1,processEntities:!1,htmlEntities:!1,parseTagValue:!1,parseAttributeValue:!1,alwaysCreateTextNode:!1,ignoreAttributes:!1,ignorePiTags:!0,ignoreDeclaration:!0,attributeNamePrefix:"@",transformTagName:(J)=>J.toLowerCase(),transformAttributeName:(J)=>J.toLowerCase()};var dY={unrecognizedFeedFormat:"Unrecognized feed format",invalidFeedFormat:"Invalid feed format",invalidOpmlFormat:"Invalid OPML format",invalidInputOpml:"Invalid input OPML",invalidInputAtom:"Invalid input Atom",invalidInputRss:"Invalid input RSS"},aA={admin:["http://webns.net/mvcb/","https://webns.net/mvcb/","http://webns.net/mvcb","https://webns.net/mvcb"],atom:["http://www.w3.org/2005/Atom","https://www.w3.org/2005/Atom","http://www.w3.org/2005/Atom/","https://www.w3.org/2005/Atom/","http://purl.org/atom/ns#","https://purl.org/atom/ns#"],app:["http://www.w3.org/2007/app","https://www.w3.org/2007/app","http://www.w3.org/2007/app/","https://www.w3.org/2007/app/"],dc:["http://purl.org/dc/elements/1.1/","https://purl.org/dc/elements/1.1/","http://purl.org/dc/elements/1.1","https://purl.org/dc/elements/1.1","http://dublincore.org/documents/dcmi-namespace/","https://dublincore.org/documents/dcmi-namespace/","http://dublincore.org/documents/dcmi-namespace","https://dublincore.org/documents/dcmi-namespace","http://purl.org/dc/elements/1.0/","https://purl.org/dc/elements/1.0/","http://purl.org/dc/elements/1.0","https://purl.org/dc/elements/1.0"],sy:["http://purl.org/rss/1.0/modules/syndication/","https://purl.org/rss/1.0/modules/syndication/","http://purl.org/rss/1.0/modules/syndication","https://purl.org/rss/1.0/modules/syndication"],content:["http://purl.org/rss/1.0/modules/content/","https://purl.org/rss/1.0/modules/content/","http://purl.org/rss/1.0/modules/content","https://purl.org/rss/1.0/modules/content"],creativeCommons:["http://backend.userland.com/creativeCommonsRssModule","https://backend.userland.com/creativeCommonsRssModule","http://backend.userland.com/creativeCommonsRssModule/","https://backend.userland.com/creativeCommonsRssModule/","http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html","https://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html","http://cyber.law.harvard.edu/rss/creativeCommonsRssModule","https://cyber.law.harvard.edu/rss/creativeCommonsRssModule"],slash:["http://purl.org/rss/1.0/modules/slash/","https://purl.org/rss/1.0/modules/slash/","http://purl.org/rss/1.0/modules/slash","https://purl.org/rss/1.0/modules/slash"],itunes:["http://www.itunes.com/dtds/podcast-1.0.dtd","https://www.itunes.com/dtds/podcast-1.0.dtd"],podcast:["https://podcastindex.org/namespace/1.0","http://podcastindex.org/namespace/1.0","https://podcastindex.org/namespace/1.0/","http://podcastindex.org/namespace/1.0/","https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md"],psc:["http://podlove.org/simple-chapters","https://podlove.org/simple-chapters","http://podlove.org/simple-chapters/","https://podlove.org/simple-chapters/"],media:["http://search.yahoo.com/mrss/","https://search.yahoo.com/mrss/","http://search.yahoo.com/mrss","https://search.yahoo.com/mrss","http://video.search.yahoo.com/mrss","http://video.search.yahoo.com/mrss/","https://video.search.yahoo.com/mrss","https://video.search.yahoo.com/mrss/","http://www.rssboard.org/media-rss","http://www.rssboard.org/media-rss/","https://www.rssboard.org/media-rss","https://www.rssboard.org/media-rss/","http://search.yahoo.com/searchmonkey/media/","https://search.yahoo.com/searchmonkey/media/","http://search.yahoo.com/searchmonkey/media","https://search.yahoo.com/searchmonkey/media","http://tools.search.yahoo.com/mrss/","https://tools.search.yahoo.com/mrss/","http://tools.search.yahoo.com/mrss","https://tools.search.yahoo.com/mrss"],georss:["http://www.georss.org/georss","http://www.georss.org/georss/","https://www.georss.org/georss","https://www.georss.org/georss/"],geo:["http://www.w3.org/2003/01/geo/wgs84_pos#","https://www.w3.org/2003/01/geo/wgs84_pos#"],thr:["http://purl.org/syndication/thread/1.0","https://purl.org/syndication/thread/1.0","http://purl.org/syndication/thread/1.0/","https://purl.org/syndication/thread/1.0/","http://purl.org/rss/1.0/modules/threading/","https://purl.org/rss/1.0/modules/threading/","http://purl.org/rss/1.0/modules/threading","https://purl.org/rss/1.0/modules/threading"],dcterms:["http://purl.org/dc/terms/","https://purl.org/dc/terms/","http://purl.org/dc/terms","https://purl.org/dc/terms","http://dublincore.org/documents/dcmi-terms/","https://dublincore.org/documents/dcmi-terms/","http://dublincore.org/documents/dcmi-terms","https://dublincore.org/documents/dcmi-terms","http://dublincore.org/specifications/dublin-core/dcmi-terms/","https://dublincore.org/specifications/dublin-core/dcmi-terms/","http://dublincore.org/specifications/dublin-core/dcmi-terms","https://dublincore.org/specifications/dublin-core/dcmi-terms"],wfw:["http://wellformedweb.org/CommentAPI/","https://wellformedweb.org/CommentAPI/","http://wellformedweb.org/CommentAPI","https://wellformedweb.org/CommentAPI"],source:["http://source.scripting.com/","https://source.scripting.com/","http://source.scripting.com","https://source.scripting.com"],feedpress:["https://feed.press/xmlns","http://feed.press/xmlns","https://feed.press/xmlns/","http://feed.press/xmlns/","https://feedpress.com/xmlns","http://feedpress.com/xmlns","https://feedpress.com/xmlns/","http://feedpress.com/xmlns/","http://feedpress.it/xmlns","https://feedpress.it/xmlns","http://feedpress.it/xmlns/","https://feedpress.it/xmlns/"],yt:["http://www.youtube.com/xml/schemas/2015","https://www.youtube.com/xml/schemas/2015","http://www.youtube.com/xml/schemas/2015/","https://www.youtube.com/xml/schemas/2015/"],googleplay:["https://www.google.com/schemas/play-podcasts/1.0/","http://www.google.com/schemas/play-podcasts/1.0/","https://www.google.com/schemas/play-podcasts/1.0","http://www.google.com/schemas/play-podcasts/1.0","https://www.google.com/schemas/play-podcasts/1.0/play-podcasts.xsd","http://www.google.com/schemas/play-podcasts/1.0/play-podcasts.xsd"],spotify:["http://www.spotify.com/ns/rss","https://www.spotify.com/ns/rss","http://www.spotify.com/ns/rss/","https://www.spotify.com/ns/rss/"],rdf:["http://www.w3.org/1999/02/22-rdf-syntax-ns#","https://www.w3.org/1999/02/22-rdf-syntax-ns#"],rawvoice:["http://www.rawvoice.com/rawvoiceRssModule/","https://www.rawvoice.com/rawvoiceRssModule/","http://www.rawvoice.com/rawvoiceRssModule","https://www.rawvoice.com/rawvoiceRssModule","https://blubrry.com/developer/rawvoice-rss","http://blubrry.com/developer/rawvoice-rss","https://blubrry.com/developer/rawvoice-rss/","http://blubrry.com/developer/rawvoice-rss/"],cc:["http://creativecommons.org/ns#","https://creativecommons.org/ns#","http://web.resource.org/cc/","https://web.resource.org/cc/","http://web.resource.org/cc","https://web.resource.org/cc"],opensearch:["http://a9.com/-/spec/opensearch/1.1/","https://a9.com/-/spec/opensearch/1.1/","http://a9.com/-/spec/opensearch/1.0/","https://a9.com/-/spec/opensearch/1.0/","http://a9.com/-/spec/opensearchrss/1.0/","https://a9.com/-/spec/opensearchrss/1.0/"],arxiv:["http://arxiv.org/schemas/atom","https://arxiv.org/schemas/atom","http://arxiv.org/schemas/atom/","https://arxiv.org/schemas/atom/"],pingback:["http://madskills.com/public/xml/rss/module/pingback/","https://madskills.com/public/xml/rss/module/pingback/","http://madskills.com/public/xml/rss/module/pingback","https://madskills.com/public/xml/rss/module/pingback"],trackback:["http://madskills.com/public/xml/rss/module/trackback/","https://madskills.com/public/xml/rss/module/trackback/","http://madskills.com/public/xml/rss/module/trackback","https://madskills.com/public/xml/rss/module/trackback"]},XC=Object.entries(aA).reduce((J,[Q,Y])=>{for(let X of Y){let G=X.toLowerCase();J[G]=Q.toLowerCase()}return J},{});var BV8=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",NV8="[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]["+BV8+"]*",DV8=new RegExp("^"+NV8+"$");function Y41(J,Q){let Y=[],X=Q.exec(J);while(X){let G=[];G.startIndex=Q.lastIndex-X[0].length;let Z=X.length;for(let q=0;q<Z;q++)G.push(X[q]);Y.push(G),X=Q.exec(J)}return Y}var GC=function(J){let Q=DV8.exec(J);return!(Q===null||typeof Q>"u")};function C56(J){return typeof J<"u"}var MV8={allowBooleanAttributes:!1,unpairedTags:[]};function y56(J,Q){Q=Object.assign({},MV8,Q);let Y=[],X=!1,G=!1;if(J[0]==="\uFEFF")J=J.substr(1);for(let Z=0;Z<J.length;Z++)if(J[Z]==="<"&&J[Z+1]==="?"){if(Z+=2,Z=S56(J,Z),Z.err)return Z}else if(J[Z]==="<"){let q=Z;if(Z++,J[Z]==="!"){Z=_56(J,Z);continue}else{let V=!1;if(J[Z]==="/")V=!0,Z++;let K="";for(;Z<J.length&&J[Z]!==">"&&J[Z]!==" "&&J[Z]!=="\t"&&J[Z]!==`
|
|
4612
4612
|
`&&J[Z]!=="\r";Z++)K+=J[Z];if(K=K.trim(),K[K.length-1]==="/")K=K.substring(0,K.length-1),Z--;if(!TV8(K)){let z;if(K.trim().length===0)z="Invalid space after '<'.";else z="Tag '"+K+"' is an invalid name.";return A2("InvalidTag",z,pQ(J,Z))}let W=OV8(J,Z);if(W===!1)return A2("InvalidAttr","Attributes for '"+K+"' have open quote.",pQ(J,Z));let H=W.value;if(Z=W.index,H[H.length-1]==="/"){let z=Z-H.length;H=H.substring(0,H.length-1);let U=k56(H,Q);if(U===!0)X=!0;else return A2(U.err.code,U.err.msg,pQ(J,z+U.err.line))}else if(V)if(!W.tagClosed)return A2("InvalidTag","Closing tag '"+K+"' doesn't have proper closing.",pQ(J,Z));else if(H.trim().length>0)return A2("InvalidTag","Closing tag '"+K+"' can't have attributes or invalid starting.",pQ(J,q));else if(Y.length===0)return A2("InvalidTag","Closing tag '"+K+"' has not been opened.",pQ(J,q));else{let z=Y.pop();if(K!==z.tagName){let U=pQ(J,z.tagStartPos);return A2("InvalidTag","Expected closing tag '"+z.tagName+"' (opened in line "+U.line+", col "+U.col+") instead of closing tag '"+K+"'.",pQ(J,q))}if(Y.length==0)G=!0}else{let z=k56(H,Q);if(z!==!0)return A2(z.err.code,z.err.msg,pQ(J,Z-H.length+z.err.line));if(G===!0)return A2("InvalidXml","Multiple possible root nodes found.",pQ(J,Z));else if(Q.unpairedTags.indexOf(K)!==-1);else Y.push({tagName:K,tagStartPos:q});X=!0}for(Z++;Z<J.length;Z++)if(J[Z]==="<")if(J[Z+1]==="!"){Z++,Z=_56(J,Z);continue}else if(J[Z+1]==="?"){if(Z=S56(J,++Z),Z.err)return Z}else break;else if(J[Z]==="&"){let z=IV8(J,Z);if(z==-1)return A2("InvalidChar","char '&' is not expected.",pQ(J,Z));Z=z}else if(G===!0&&!j56(J[Z]))return A2("InvalidXml","Extra text at the end",pQ(J,Z));if(J[Z]==="<")Z--}}else{if(j56(J[Z]))continue;return A2("InvalidChar","char '"+J[Z]+"' is not expected.",pQ(J,Z))}if(!X)return A2("InvalidXml","Start tag expected.",1);else if(Y.length==1)return A2("InvalidTag","Unclosed tag '"+Y[0].tagName+"'.",pQ(J,Y[0].tagStartPos));else if(Y.length>0)return A2("InvalidXml","Invalid '"+JSON.stringify(Y.map((Z)=>Z.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1});return!0}function j56(J){return J===" "||J==="\t"||J===`
|
|
@@ -4768,7 +4768,7 @@ exit code: ${Z}`,new z1({color:X.foreground,dim:!0,italic:!0})));if(q)V.push(new
|
|
|
4768
4768
|
`,M),...L],E=[new l1({text:new J1("",void 0,A)})];if(W.url){let I=W.url.replace(/^https?:\/\//,"");E.push(new q4({children:[new l1({text:new J1("See more: ",M)}),new i2({uri:W.url,text:I,style:new z1({color:Y.secondary,underline:!0})})]}))}let P=new s0({crossAxisAlignment:"stretch",mainAxisSize:"min",children:E});return H8.child(new Q6({constraints:new r6(40,120,0,1/0),child:new q4({mainAxisAlignment:"center",crossAxisAlignment:"center",children:[new U4({flex:1,child:new iC1({width:40,height:40,agentMode:this.agentMode,...V&&{primaryColor:{r:0,g:55,b:0},secondaryColor:{r:0,g:255,b:136}},fps:q==="fast"?60:q==="slow"?15:0,...q==="disabled"&&{seed:42,t:3}})}),new M0({width:1}),new U4({flex:2,child:P})]})}))}}L0();B9();M4();b7();B9();o0();function vB8(J,Q){return`${J}:${Q}`}class A_1{threadService;workers=new Map;threadsMap=new Map;subthreadsMap=new Map;mainThreadSubs=new Map;subthreadsSubs=new Map;workerStatusSubs=new Map;subthreadPatchSubs=new Map;mainThreadObservable;subthreadObservable;workerStatusObservable;emitMainThread=null;emitSubthread=null;emitWorkerStatus=null;constructor(J){this.threadService=J;this.mainThreadObservable=new X0((Q)=>{return this.emitMainThread=(Y)=>Q.next(Y),()=>{this.emitMainThread=null}}),this.subthreadObservable=new X0((Q)=>{return this.emitSubthread=(Y)=>Q.next(Y),()=>{this.emitSubthread=null}}),this.workerStatusObservable=new X0((Q)=>{return this.emitWorkerStatus=(Y)=>Q.next(Y),()=>{this.emitWorkerStatus=null}})}registerWorker(J){let Q=J.thread.id;if(this.workers.has(Q))this.unregisterWorker(Q);this.threadsMap.set(Q,J.thread),this.subthreadsMap.set(Q,[]),this.workers.set(Q,{state:"initial"});let Y=this.threadService.observePatches(Q).pipe(BM()).subscribe((Z)=>{this.threadsMap.set(Q,Z);let q=this.subthreadsMap.get(Q)||[],V=this.workers.get(Q)||{state:"initial"};if(this.emitMainThread)this.emitMainThread({threadID:Q,mainThread:Z,subthreads:q,workerStatus:V})});this.mainThreadSubs.set(Q,Y);let X=J.status.subscribe((Z)=>{if(this.workers.set(Q,Z),this.emitWorkerStatus)this.emitWorkerStatus({threadID:Q,status:Z})});this.workerStatusSubs.set(Q,X);let G=J.subthreads.subscribe((Z)=>{this.subthreadsMap.set(Q,Z);for(let q of Z){let V=vB8(Q,q.toolUse.id);if(this.subthreadPatchSubs.has(V))continue;let K=this.threadService.observePatches(q.threadID).pipe(BM()).subscribe((W)=>{if(this.emitSubthread)this.emitSubthread({threadID:Q,thread:W,subthread:q})});this.subthreadPatchSubs.set(V,K)}});this.subthreadsSubs.set(Q,G)}unregisterWorker(J){let Q=this.mainThreadSubs.get(J);if(Q)Q.unsubscribe(),this.mainThreadSubs.delete(J);let Y=this.workerStatusSubs.get(J);if(Y)Y.unsubscribe(),this.workerStatusSubs.delete(J);let X=this.subthreadsSubs.get(J);if(X)X.unsubscribe(),this.subthreadsSubs.delete(J);for(let[G,Z]of this.subthreadPatchSubs.entries())if(G.startsWith(`${J}:`))Z.unsubscribe(),this.subthreadPatchSubs.delete(G);this.workers.delete(J),this.threadsMap.delete(J),this.subthreadsMap.delete(J)}observeThread(J){return{mainThread:new X0((Q)=>{return this.mainThreadObservable.subscribe((Y)=>{if(Y.threadID===J)Q.next(Y)})}),subthreads:new X0((Q)=>{return this.subthreadObservable.subscribe((Y)=>{if(Y.threadID===J)Q.next(Y)})}),workerStatus:new X0((Q)=>{return this.workerStatusObservable.subscribe((Y)=>{if(Y.threadID===J)Q.next(Y)})})}}get threadViewStates(){let J={};for(let[Q,Y]of this.threadsMap){let X=this.workers.get(Q);if(X)J[Q]=WA(Y,X)}return J}dispose(){for(let J of this.mainThreadSubs.values())J.unsubscribe();for(let J of this.subthreadsSubs.values())J.unsubscribe();for(let J of this.workerStatusSubs.values())J.unsubscribe();for(let J of this.subthreadPatchSubs.values())J.unsubscribe();this.mainThreadSubs.clear(),this.subthreadsSubs.clear(),this.workerStatusSubs.clear(),this.subthreadPatchSubs.clear(),this.workers.clear(),this.threadsMap.clear(),this.subthreadsMap.clear()}}function fB8(J,Q){switch(Q.type){case"subthread-patch":{let{thread:Y,subthread:X}=Q,G=J.subagents[X.threadID];if(!G){if(G={subThreadID:Y.id,parentToolID:X.toolUse.id,taskDescription:X.toolUse.input.description||"Task",isCompleted:!1,agentState:{type:"idle"}},J.mainThread){let W=oJ(J.mainThread);G.isCompleted=UQ6(W,X.toolUse.id)}}let Z=hB8(Y,G.agentState),q=G.agentState===Z?G:{...G,agentState:Z},V={...J.tools},K=SC(Y).items.filter((W)=>W.type==="toolResult");for(let W of K)V[W.id]={id:W.id,subthreadID:Y.id,toolRun:W.toolResult.run,toolUse:W.toolUse};return{subagents:{...J.subagents,[X.threadID]:q},tools:V,items:J.items,viewState:J.viewState,todosList:J.todosList,mainThread:J.mainThread}}case"main-thread-patch":{let{thread:Y,subthreads:X,workerStatus:G}=Q,Z=oJ(Y),q={...J.subagents};for(let z of X){let U=q[z.threadID];if(!U)continue;let N=UQ6(Z,z.toolUse.id);q[z.threadID]={...U,isCompleted:N}}let{items:V}=SC(Y),K=WA(Y,G),W=JI({messages:Y.messages}),H=Array.isArray(W)?W:[];return{...J,subagents:q,items:V,viewState:K,todosList:H,mainThread:Y}}case"worker-status-change":{if(!J.mainThread)return J;let Y=WA(J.mainThread,Q.workerStatus);if(Y===J.viewState)return J;return{...J,viewState:Y}}default:return J}}function SC(J){let Q=[],Y=new Map,X=new Set;for(let[G,Z]of J.messages.entries()){let q=`${Z.role}-${G}`;switch(Z.role){case"assistant":{let V=Z.state.type==="streaming";for(let W of Z.content)if(W.type==="tool_use"){if(Y.set(W.id,W),V)X.add(W.id)}if(Z.content.some((W)=>W.type==="text"&&W.text.trim()||W.type==="thinking"))Q.push({type:"message",id:q,message:Z});for(let W of Z.content)if(W.type==="tool_use"){let H=!1;for(let z=G+1;z<J.messages.length;z++){let U=J.messages[z];if(U){for(let N of U.content)if(N.type==="tool_result"&&N.toolUseID===W.id){H=!0;break}}if(H)break}if(!H)Q.push({type:"toolResult",id:W.id,toolUse:W,toolResult:{type:"tool_result",toolUseID:W.id,run:{status:V?"in-progress":"queued"}}})}break}case"info":Q.push({type:"message",id:q,message:Z});break;case"user":{if(Z.content.some((K)=>K.type==="text"&&K.text.trim()||K.type==="image"))Q.push({type:"message",id:q,message:Z});for(let K of Z.content)if(K.type==="tool_result"){let W=Y.get(K.toolUseID)??DX(J,K.toolUseID);if(!W)throw Error(`(bug) tool use ${K.toolUseID} not found`);Q.push({type:"toolResult",id:K.toolUseID,toolUse:W,toolResult:K})}break}}}return{items:Q}}function UQ6(J,Q){let Y=J.get(Q);return(Y&&H2(Y.run))??!1}function hB8(J,Q){let Y=J.messages.at(-1);if(Y?.content.some((G)=>G.type==="tool_result"&&G.run.status==="blocked-on-user"))return f.info("Subagent status: idle (blocked-on-user)",{threadID:J.id}),{type:"idle"};if(SC(J).items.some((G)=>G.type==="toolResult"&&G.toolResult.run.status==="in-progress")){let G=Q?.type==="running-tools"?Q.startTime:Date.now();return f.info("Subagent status: running-tools",{threadID:J.id,startTime:G,hasStartTime:!!G}),{type:"running-tools",startTime:G}}if(Y&&Y.role==="assistant"&&Y.state.type==="streaming")switch(Y.content.at(-1)?.type){case"text":return f.info("Subagent status: streaming-text",{threadID:J.id}),{type:"streaming-text"};case"thinking":return f.info("Subagent status: streaming-thinking",{threadID:J.id}),{type:"streaming-thinking"};case"tool_use":{let Z=Q?.type==="running-tools"?Q.startTime:Date.now();return f.info("Subagent status: running-tools (streaming tool_use)",{threadID:J.id,startTime:Z,hasStartTime:!!Z}),{type:"running-tools",startTime:Z}}default:return f.info("Subagent status: streaming-text (default)",{threadID:J.id}),{type:"streaming-text"}}return f.info("Subagent status: idle (default)",{threadID:J.id}),{type:"idle"}}class O_1 extends G6{props;constructor(J){super();this.props=J}createState(){return new BQ6}}class BQ6 extends X6{state={subagents:{},tools:{},items:[],viewState:{state:"initial",interactionState:!1,toolState:{running:0,blocked:0}},todosList:[],mainThread:null};workerController;subscriptions=[];recentThreadIDs=[];currentWorker;constructor(){super();this.workerController=null,this.currentWorker=null}addToRecentThreads(J){this.setState(()=>{let Q=this.recentThreadIDs.indexOf(J);if(Q!==-1)this.recentThreadIDs.splice(Q,1);if(this.recentThreadIDs.unshift(J),this.recentThreadIDs.length>50)this.recentThreadIDs.pop()})}initState(){let{threadService:J,worker:Q}=this.widget.props;this.workerController=new A_1(J),this.currentWorker=Q,this.setupSubscriptions(Q),this.addToRecentThreads(Q.thread.id)}dispose(){this.cleanup()}didUpdateWidget(J){if(J.props.threadService!==this.widget.props.threadService||J.props.worker!==this.widget.props.worker)this.cleanup(),this.setupSubscriptions(this.widget.props.worker)}setupSubscriptions(J){this.workerController.registerWorker(J);let Q=this.workerController.observeThread(J.thread.id),Y=Q.mainThread.subscribe((Z)=>{this.dispatch({type:"main-thread-patch",thread:Z.mainThread,subthreads:Z.subthreads,workerStatus:Z.workerStatus})});this.subscriptions.push(Y);let X=Q.subthreads.subscribe((Z)=>{this.dispatch({type:"subthread-patch",thread:Z.thread,subthread:Z.subthread})});this.subscriptions.push(X);let G=Q.workerStatus.subscribe((Z)=>{this.dispatch({type:"worker-status-change",workerStatus:Z.status})});this.subscriptions.push(G)}cleanup(){this.subscriptions.forEach((J)=>J.unsubscribe()),this.subscriptions=[]}switchWorker(J){this.cleanup(),this.setState(()=>{this.currentWorker=J}),this.setState(()=>{this.state={subagents:{},tools:{},items:[],viewState:{state:"initial",interactionState:!1,toolState:{running:0,blocked:0}},todosList:[],mainThread:null}}),this.setupSubscriptions(J),this.addToRecentThreads(J.thread.id)}dispatch(J){this.setState(()=>{this.state=fB8(this.state,J)})}getThreadData(){let J=Object.values(this.state.tools).map((Z)=>({toolUse:Z.toolUse,toolRun:Z.toolRun,subthreadID:Z.subthreadID})),Q={};for(let Z of Object.values(this.state.subagents)){let q=J.filter((V)=>V.subthreadID===Z.subThreadID);Q[Z.parentToolID]=q}let Y=(Z)=>Z===o5||Z===$9||Z===NX,X=new Map;for(let Z of this.state.items)if(Z.type==="toolResult"&&Y(Z.toolUse.name))X.set(Z.toolUse.id,{toolUseId:Z.toolUse.id,toolName:Z.toolUse.name,toolRun:Z.toolResult.run});let G=Array.from(X.values());for(let{toolUseId:Z,toolRun:q}of G){let V=[],K;if(q.status==="in-progress"||q.status==="done"||q.status==="error"||q.status==="cancelled")K=q.progress;if(K){let W=0;for(let H of K)if(H.tool_uses)for(let z of H.tool_uses){let U=`${Z}:progress:${W++}`;V.push({toolUse:sE(z.tool_name,z.input,U),toolRun:{status:z.status}})}}Q[Z]=V}return{...this.state,subagents:Object.values(this.state.subagents),subagentActiveTools:J,subagentToolsByParentID:Q}}build(J){let Q=this.getThreadData();return this.widget.props.builder(J,Q,this.workerController,(Y)=>this.switchWorker(Y),()=>this.currentWorker,this.recentThreadIDs)}}class w_1 extends G6{props;constructor(J){super({key:J.key});this.props=J}createState(){return new NQ6}}class NQ6 extends X6{build(J){let Y=b6.of(J).colors,{todos:X,title:G="TODOs"}=this.widget.props;if(!Array.isArray(X)||X.length===0)return new M0({width:0,height:0});let Z=X.map((q)=>this.buildTodoItem(q,Y));return new Q6({child:new c6({padding:f0.symmetric(1,0),child:new s0({crossAxisAlignment:"stretch",mainAxisSize:"min",children:[new l1({text:new J1(G,new z1({bold:!0,color:Y.foreground}))}),...Z]})})})}buildTodoItem(J,Q){let Y=this.getStatusIcon(J.status),X=J.status==="completed",G=new z1({bold:J.status==="in-progress",color:Q.foreground,dim:X}),Z=new z1({bold:J.status==="in-progress",strikethrough:J.status==="completed",color:Q.foreground,dim:X});return new q4({crossAxisAlignment:"start",children:[new l1({text:new J1(Y,G)}),new M0({width:1}),new U4({child:new l1({text:new J1(J.content,Z)})})]})}getStatusIcon(J){return J==="completed"?"✓":"•"}}class E_1 extends j6{ad;onDismiss;onButtonClick;constructor({key:J,ad:Q,onDismiss:Y,onButtonClick:X}){super({key:J});this.ad=Q,this.onDismiss=Y,this.onButtonClick=X}build(J){let Q=b6.of(J),Y=Q.colors.primary,X=Q.colors.foreground;return new Q6({decoration:new O8(void 0,new p4(new P4(Y,1,"rounded"),new P4(Y,1,"rounded"),void 0,new P4(Y,1,"rounded"))),child:new c6({padding:f0.horizontal(1),child:new s0({children:[new q4({crossAxisAlignment:"start",children:[new U4({child:new l1({text:new J1(this.ad.content,new z1({color:X}))})}),new M0({width:4}),new i2({uri:"https://ampcode.com/free",text:"Ad",style:new z1({color:X,dim:!0}),onError:(G)=>{}})]}),new q4({crossAxisAlignment:"start",children:[new Gj1({text:this.ad.buttonLabel,onPressed:()=>this.onButtonClick?.(),padding:f0.horizontal(1),color:Y,reverse:!0}),new M0({width:2}),new l1({text:new J1(this.ad.destinationUrlHostname,new z1({color:X,dim:!0}))})]})]})})})}}class I_1 extends G6{props;constructor(J){super();this.props=J}createState(){return new DQ6(this.props.autofocus??!0)}}class DQ6 extends X6{autofocus;constructor(J){super();this.autofocus=J}build(J){let Q=(V)=>{if(V.key==="Enter"&&this.widget.props.showCopyOption)return this.widget.props.onSelect("copy"),"handled";if(V.ctrlKey&&V.key==="c"||V.key==="Escape")return this.widget.props.onSelect(null),"handled";return"ignored"},Y=U8.sizeOf(J),X=Math.min(60,Y.width-4),G=Y.height-4,Z=[];if(this.widget.props.title)Z.push(new l1({text:new J1(this.widget.props.title,new z1({bold:!0,color:O1.blue}))}),new M0({height:1}));if(this.widget.props.message)Z.push(new l1({text:new J1(this.widget.props.message,void 0,void 0,{uri:this.widget.props.message,id:"ad-link"})}));if(this.widget.props.message)Z.push(new M0({height:1}));let q=[];if(this.widget.props.showCopyOption)q.push(new l1({text:new J1("Enter to copy",new z1({dim:!0}))}));return q.push(new l1({text:new J1("Escape to close",new z1({dim:!0}))})),Z.push(new q4({children:q.flatMap((V,K)=>K<q.length-1?[V,new M0({width:1}),new l1({text:new J1("•",new z1({dim:!0}))}),new M0({width:1})]:[V]),mainAxisSize:"min"})),new H8({child:new Q6({constraints:new r6(X,X,0,G),decoration:new O8(O1.default(),new p4(new P4(O1.blue,1,"rounded"),new P4(O1.blue,1,"rounded"),new P4(O1.blue,1,"rounded"),new P4(O1.blue,1,"rounded"))),padding:new f0(2,2,2,2),child:new Y9({autofocus:this.autofocus,onKey:Q,child:new s0({children:Z,mainAxisSize:"min"})})})})}}class r81 extends Error{constructor(J="Command timed out"){super(J);this.name="CommandTimeoutError",Object.setPrototypeOf(this,r81.prototype)}}class s81 extends Error{constructor(J){let Q=`${J.noun}: ${J.verb} command cancelled`;super(Q);this.name="CommandCancelledError",Object.setPrototypeOf(this,s81.prototype)}}function P_1(J){let Q=J.match(/"([^"]*)"|'([^']*)'|([^\s"']+)/g);if(!Q)return[];return Q.map((Y)=>{if(Y.startsWith('"')&&Y.endsWith('"')||Y.startsWith("'")&&Y.endsWith("'"))return Y.slice(1,-1);return Y})}ZU();L0();import{spawn as bB8}from"node:child_process";import{promises as gB8}from"node:fs";function MQ6(J){return J.kind==="executable"}function LQ6(J){return J.kind==="markdown"}var Oz=50000,AQ6=300000;async function T_1(J,Q,Y,X={}){let{timeoutMs:G=AQ6,signal:Z,source:q}=X;try{let V=await Y.getCommand(J,q);if(!V)return{success:!1,output:"",error:`Command '${J}' not found`};if(!await Y.isCommandAvailable(J,q))return{success:!1,output:"",error:`Command '${J}' is not available for execution`};if(f.debug("Executing command",{commandName:J,filePath:V.filePath,args:Q}),LQ6(V))return await mB8(V,Q);else if(MQ6(V))return await uB8(V,Q,G,Z);else return{success:!1,output:"",error:"Unsupported command type"}}catch(V){return f.error("Failed to execute command",{commandName:J,error:V}),{success:!1,output:"",error:V instanceof Error?V.message:"Unknown error occurred"}}}async function mB8(J,Q){try{if(Q.length>0)return{success:!1,output:"",error:"Markdown commands do not accept arguments"};let Y=await gB8.readFile(J.filePath,"utf8");return{success:!0,output:(Y.length>Oz?Y.slice(0,Oz)+`
|
|
4769
4769
|
... (output truncated at ${Oz} characters)`:Y).trim(),exitCode:0}}catch(Y){return{success:!1,output:"",error:Y instanceof Error?Y.message:"Failed to read markdown file"}}}async function uB8(J,Q,Y=AQ6,X){return new Promise((G)=>{let[Z,q]=pB8(J,Q);f.debug("Spawning command",{spawnCommand:Z,spawnArgs:q.slice(0,10),filePath:J.filePath,timeoutMs:Y});let V=hO0(X),K=!1,W=setTimeout(()=>{K=!0,V.abort(),f.warn("Command execution timed out",{commandName:J.name,timeoutMs:Y})},Y),H=bB8(Z,q,{stdio:["pipe","pipe","pipe"],signal:V.signal,detached:!0}),z=[],U=[],N=0;H.stdout?.on("data",(M)=>{let L=M.toString();if(N+=L.length,N<=Oz)z.push(L);else{let A=Oz-(N-L.length);if(A>0)z.push(L.slice(0,A))}}),H.stderr?.on("data",(M)=>{let L=M.toString();if(N+=L.length,N<=Oz)U.push(L);else{let A=Oz-(N-L.length);if(A>0)U.push(L.slice(0,A))}}),H.on("close",(M)=>{if(clearTimeout(W),K){G({success:!1,output:z.join(""),error:`Command timed out after ${Y}ms`,exitCode:void 0});return}if(V.signal.aborted){G({success:!1,output:z.join(""),error:"The command was aborted",exitCode:M??void 0});return}let L=M===0||M===1,A=z.join(""),E=U.join(""),P=A;if(!L&&!A.trim()&&E.trim())P=E;else if(E.trim())P+=A?`
|
|
4770
4770
|
${E}`:E;if(N>Oz)P+=`
|
|
4771
|
-
... (output truncated at ${Oz} characters)`;G({success:L,output:P.trim(),error:!L?E.trim()||"Command failed":void 0,exitCode:M??void 0})}),H.on("error",(M)=>{clearTimeout(W);let L=M.message;if(K)L=`Command timed out after ${Y}ms`;else if(M.message.includes("operation was aborted")||M.name==="AbortError")L="The command was aborted";G({success:!1,output:z.join(""),error:L})})})}function pB8(J,Q){let{filePath:Y,interpreter:X,extension:G}=J;if(process.platform==="win32")return cB8(Y,X?[...X]:null,G,Q);else return dB8(Y,X?[...X]:null,G,Q)}function dB8(J,Q,Y,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];else return[J,X]}function cB8(J,Q,Y,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];switch(Y.toLowerCase()){case".bat":case".cmd":return["cmd.exe",["/c",J,...X]];case".ps1":return["powershell.exe",["-ExecutionPolicy","Bypass","-File",J,...X]];case".exe":return[J,X];default:return[J,X]}}L0();C$();g7();fW();ZZ();u$();JH();UH();b7();i_();o0();var jQ6=N6(FP(),1);import{writeFile as TQ6}from"fs/promises";import RQ6 from"path";L0();ZZ();class R_1{enabled;configService;commandCounts=new Map;timer=null;bufferTimeMs=1e4;constructor(J,Q){this.enabled=J;this.configService=Q;this.startTimer()}startTimer(){this.timer=setInterval(()=>{this.flushEvents()},this.bufferTimeMs)}async flushEvents(){if(this.commandCounts.size===0||!await this.enabled())return;let J=Array.from(this.commandCounts.entries()).map(([Q,Y])=>({feature:"cli.command",action:Q,source:{client:"cli",clientVersion:"0.0.
|
|
4771
|
+
... (output truncated at ${Oz} characters)`;G({success:L,output:P.trim(),error:!L?E.trim()||"Command failed":void 0,exitCode:M??void 0})}),H.on("error",(M)=>{clearTimeout(W);let L=M.message;if(K)L=`Command timed out after ${Y}ms`;else if(M.message.includes("operation was aborted")||M.name==="AbortError")L="The command was aborted";G({success:!1,output:z.join(""),error:L})})})}function pB8(J,Q){let{filePath:Y,interpreter:X,extension:G}=J;if(process.platform==="win32")return cB8(Y,X?[...X]:null,G,Q);else return dB8(Y,X?[...X]:null,G,Q)}function dB8(J,Q,Y,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];else return[J,X]}function cB8(J,Q,Y,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];switch(Y.toLowerCase()){case".bat":case".cmd":return["cmd.exe",["/c",J,...X]];case".ps1":return["powershell.exe",["-ExecutionPolicy","Bypass","-File",J,...X]];case".exe":return[J,X];default:return[J,X]}}L0();C$();g7();fW();ZZ();u$();JH();UH();b7();i_();o0();var jQ6=N6(FP(),1);import{writeFile as TQ6}from"fs/promises";import RQ6 from"path";L0();ZZ();class R_1{enabled;configService;commandCounts=new Map;timer=null;bufferTimeMs=1e4;constructor(J,Q){this.enabled=J;this.configService=Q;this.startTimer()}startTimer(){this.timer=setInterval(()=>{this.flushEvents()},this.bufferTimeMs)}async flushEvents(){if(this.commandCounts.size===0||!await this.enabled())return;let J=Array.from(this.commandCounts.entries()).map(([Q,Y])=>({feature:"cli.command",action:Q,source:{client:"cli",clientVersion:"0.0.1764148488-g9863c7"},parameters:{metadata:{count:Y}},timestamp:Date.now()*1000}));this.commandCounts.clear();try{let Q=JSON.stringify(J);await Xr(Q,this.configService)}catch(Q){f.error("Failed to export command telemetry events",Q)}}async submit(J){if(!await this.enabled()||this.timer===null)return;let Q=this.commandCounts.get(J)||0;this.commandCounts.set(J,Q+1)}async dispose(){if(await this.flushEvents(),this.timer!==null)clearInterval(this.timer),this.timer=null}}class C_1 extends G6{props;constructor(J){super();this.props=J}createState(){return new OQ6}}class OQ6 extends X6{_state;initState(){super.initState(),this._state=this.widget.props.initialState}build(J){let Q=(Y)=>{this.setState(()=>{this._state=Y(this._state)})};return this.widget.props.builder(J,Q,this._state)}}class wQ6 extends X6{controller=new hZ;focusNode=new i8({debugLabel:"CommandArgumentPrompt",onKey:(J)=>{if(J.key==="Escape")return this.widget.props.onDismiss(),"handled";return"ignored"}});_textListener=()=>{this.setState(()=>{})};initState(){this.focusNode.requestFocus(),this.controller.addListener(this._textListener)}dispose(){this.controller.removeListener(this._textListener),this.focusNode.dispose()}build(J){let Q=b6.of(J),{colors:Y,app:X}=Q,G=this.widget.props.isRequiredArg??!0,Z=this.controller.text.trim().length>0,q=!G||Z,V=p4.all(new P4(Y.foreground,1,"solid")),K=new XO({controller:this.controller,focusNode:this.focusNode,placeholder:this.widget.props.placeholder??"Enter command argument...",onSubmitted:(N)=>{let M=N.trim();if(G&&M.length===0)return;this.widget.props.onSubmit(M)},autofocus:!0,style:{textColor:Y.foreground,border:null},maxLines:1}),W=new q4({children:[new Q6({decoration:{color:O1.default()},child:new l1({text:new J1(">",new z1({color:Y.foreground}))})}),new U4({child:K})]}),H=new Q6({padding:f0.symmetric(1,0),child:new l1({text:new J1("",void 0,[new J1("Command: ",new z1({color:Y.foreground})),new J1(this.widget.props.commandName,new z1({color:O1.yellow,bold:!0}))])})}),z=[];if(q)z.push(new J1("Enter",new z1({color:X.keybind}))),z.push(new J1(" to submit, ",new z1({color:Y.foreground,dim:!0})));z.push(new J1("Esc",new z1({color:X.keybind}))),z.push(new J1(" to cancel",new z1({color:Y.foreground,dim:!0})));let U=new Q6({padding:f0.symmetric(1,0),child:new l1({text:new J1("",void 0,z)})});return new Q6({decoration:{border:V,color:O1.default()},padding:f0.all(1),child:new s0({children:[H,new M0({height:1}),W,new c5,U]})})}}class t81 extends G6{props;constructor(J){super();this.props=J}createState(){return new wQ6}}JH();class EQ6 extends X6{controller=new hZ;imageAttachments=[];imagePaths=[];isConfirmingClearInput=!1;clearInputConfirmTimeout=null;focusNode=new i8({debugLabel:"CommandMultilinePrompt",onKey:(J)=>{if(J.key==="Escape"){if(this.isConfirmingClearInput){if(this.controller.clear(),this.setState(()=>{this.isConfirmingClearInput=!1,this.imageAttachments=[],this.imagePaths=[]}),this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout),this.clearInputConfirmTimeout=null;return"handled"}if(this.controller.text.trim()!==""||this.imageAttachments.length>0){if(this.setState(()=>{this.isConfirmingClearInput=!0}),this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout);return this.clearInputConfirmTimeout=setTimeout(()=>{this.setState(()=>{this.isConfirmingClearInput=!1}),this.clearInputConfirmTimeout=null},1000),"handled"}return this.widget.props.onDismiss(),"handled"}return"ignored"}});initState(){if(this.widget.props.initialText)this.controller.text=this.widget.props.initialText;if(this.widget.props.initialImages)this.imageAttachments=[...this.widget.props.initialImages];this.focusNode.requestFocus()}_handleInsertImage=(J)=>{if(this.imageAttachments.length>=$U)return!1;let Q=FC(J);if(typeof Q==="object")return this.setState(()=>{this.imageAttachments=[...this.imageAttachments,Q],this.imagePaths=[...this.imagePaths,J]}),!1;return!1};_handlePopImage=()=>{if(this.imageAttachments.length>0)this.setState(()=>{this.imageAttachments=this.imageAttachments.slice(0,-1),this.imagePaths=this.imagePaths.slice(0,-1)})};dispose(){if(this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout),this.clearInputConfirmTimeout=null;this.focusNode.dispose(),this.controller.dispose()}build(J){let Q=b6.of(J),{colors:Y,app:X}=Q,Z=U8.of(J).size.height,q=Math.max(Math.floor(Z*0.5),10),V=new MO({controller:this.controller,triggers:[new WN],completionBuilder:this.widget.props.completionBuilder,ampURL:this.widget.props.ampURL,onSubmitted:(N)=>{this.widget.props.onSubmit(N.trim(),this.imageAttachments)},theme:Y,placeholder:this.widget.props.placeholder||"Enter your message...",enabled:this.widget.props.enabled??!0,autofocus:!0,clipboard:E9.instance.tuiInstance.clipboard,showMenuBelow:!0,onInsertImage:this.widget.props.onInsertImage??this._handleInsertImage,imageAttachments:this.imageAttachments,popImage:this._handlePopImage}),K=new Y9({focusNode:this.focusNode,child:V}),W=new Q6({constraints:new r6({maxHeight:q}),padding:f0.symmetric(1,0),child:K}),H=new Q6({padding:f0.symmetric(1,0),child:new l1({text:new J1("",void 0,[new J1("Command: ",new z1({color:Y.foreground})),new J1(this.widget.props.commandName,new z1({color:O1.yellow,bold:!0}))])})}),z=new Q6({padding:f0.symmetric(1,0),child:new l1({text:this.isConfirmingClearInput?new J1("",void 0,[new J1("Esc",new z1({color:X.keybind})),new J1(" again to clear input",new z1({color:Y.foreground,dim:!0}))]):new J1("",void 0,[new J1("Press ",new z1({color:Y.foreground,dim:!0})),new J1("Enter",new z1({color:X.keybind})),new J1(" to submit, ",new z1({color:Y.foreground,dim:!0})),new J1("Esc",new z1({color:X.keybind})),new J1(" to clear",new z1({color:Y.foreground,dim:!0}))])})}),U=[H,new M0({height:1}),new U4({child:W}),new M0({height:1}),z];return new Q6({decoration:{border:p4.all(new P4(Y.foreground,1,"solid")),color:O1.default()},padding:f0.all(1),child:new s0({children:U})})}}class LO extends G6{props;constructor(J){super();this.props=J}createState(){return new EQ6}}class j_1 extends j6{props;constructor(J){super();this.props=J}build(){return new H8({child:new l1({text:new J1("",void 0,[new J1(`Forked to new thread:
|
|
4772
4772
|
|
|
4773
4773
|
`,new z1({color:O1.white,dim:!0})),new J1(`"${this.props.newThreadTitle||"Untitled"}"`,new z1({color:O1.white}))]),textAlign:"center"})})}}class wz extends G6{props;constructor(J){super();this.props=J}createState(){return new IQ6}}class IQ6 extends X6{_spinner=new hK;animationInterval=null;initState(){super.initState(),this.animationInterval=setInterval(()=>{this._spinner.step(),this.setState(()=>{})},100)}dispose(){if(this.animationInterval)clearInterval(this.animationInterval),this.animationInterval=null;super.dispose()}build(J){let Q=b6.of(J),{colors:Y}=Q,X=p4.all(new P4(Y.foreground,1,"solid")),G=this._spinner.toBraille(),Z=new l1({textAlign:"center",text:new J1("",void 0,[new J1(G,new z1({color:O1.yellow})),new J1(" ",void 0),new J1(this.widget.props.message,new z1({color:Y.foreground}))])}),V=[new U4({child:new s0({mainAxisAlignment:"center",crossAxisAlignment:"center",children:[Z]})})];if(this.widget.props.onAbort)V.push(new M0({height:2,child:new Q6({padding:f0.symmetric(2,0),child:new l1({text:new J1("",new z1({dim:!0}),[new J1("Press ",new z1({color:Y.foreground})),new J1("Esc",new z1({color:Y.info})),new J1(" to cancel",new z1({color:Y.foreground}))])})})}));let K=new Q6({decoration:new O8(O1.default(),X),child:new M0({width:60,height:7,child:new s0({mainAxisAlignment:"start",children:V})})});if(this.widget.props.onAbort)return new Y9({debugLabel:"LoadingDialog",autofocus:!0,onKey:(W)=>{if(W.key==="Escape")return this.widget.props.onAbort?.(),"handled";return"ignored"},child:K});return K}}class Ez extends G6{props;constructor(J){super();this.props=J}createState(){return new PQ6}}class PQ6 extends X6{dispose(){super.dispose()}isWidgetMessage(J){return J instanceof yK}build(J){let Q=this.widget.props.message,Y=(()=>{if(this.isWidgetMessage(Q))return{title:Q.title,type:Q.type};if(Q instanceof Error&&Q.name==="CommandCancelledError")return{title:"Cancelled",type:"info",description:Q.message};if(Q instanceof Error&&Q.name==="CommandTimeoutError")return{title:"Timeout",type:"error",description:Q.message};let W=G81(Q);return{title:W.title,type:W.type,description:W.description}})(),X=Y.type==="error"?O1.red:O1.yellow,G=p4.all(new P4(O1.default(),1,"solid")),Z=new Q6({padding:f0.symmetric(1,0),child:new l1({text:new J1(Y.title,new z1({color:X,bold:!0}))})}),q=this.isWidgetMessage(Q)?Q.widget:new l1({text:new J1(Y.description,new z1({color:O1.default()})),selectable:!0}),V=new U4({child:new JO({child:new Q6({padding:f0.symmetric(1,0),child:q})})}),K=new Q6({padding:f0.symmetric(1,0),child:new l1({text:this.widget.props.onRetry?new J1("",void 0,[new J1("Press ",new z1({color:O1.default(),dim:!0})),new J1("R",new z1({color:O1.yellow})),new J1(" to retry, ",new z1({color:O1.default(),dim:!0})),new J1("Esc",new z1({color:O1.yellow})),new J1(" to cancel",new z1({color:O1.default(),dim:!0}))]):new J1("Press any key to close",new z1({color:O1.default(),dim:!0,italic:!0}))})});return new Y9({onKey:(W)=>{if(this.widget.props.onRetry&&W.key==="r")return this.widget.props.onRetry(),"handled";if(W.key==="Escape")return this.widget.props.onDismiss(),"handled";if(!this.widget.props.onRetry)return this.widget.props.onDismiss(),"handled";return"ignored"},autofocus:!0,child:new Q6({decoration:{border:G,color:O1.default()},padding:f0.all(1),child:new s0({mainAxisAlignment:"center",children:[Z,new M0({height:1}),V,K]})})})}}class S_1 extends j6{build(){return new H8({child:new l1({text:new J1("",void 0,[new J1(`✓ Thread Shared
|
|
4774
4774
|
|
|
@@ -4854,7 +4854,7 @@ https://www.jetbrains.com/help/idea/managing-plugins.html#install_plugin_from_di
|
|
|
4854
4854
|
`)?`${V}...`:G,W=new z1({color:O1.index(8)}),H=[new J1(K,W)];if(q>0){let z=new z1({color:Y.success});for(let U=1;U<=q;U++)H.push(new J1(" ")),H.push(new J1(`[${U}]`,z))}return new c6({padding:f0.only({bottom:0}),child:new q4({crossAxisAlignment:"start",children:[new c6({padding:f0.only({right:1}),child:new l1({text:new J1("•",new z1({color:O1.index(8)}))})}),new U4({child:new l1({text:new J1("",void 0,H)})})]})})}}class $k1 extends G6{createState(){return new OY6}}class OY6 extends X6{_animationTimer;_visible=!0;initState(){super.initState(),this._startAnimation()}dispose(){this._stopAnimation(),super.dispose()}_startAnimation(){this._animationTimer=setInterval(()=>{this.setState(()=>{this._visible=!this._visible})},500)}_stopAnimation(){if(this._animationTimer)clearInterval(this._animationTimer),this._animationTimer=void 0}build(J){let Q=new z1({color:O1.red}),Y=new z1({color:this._visible?O1.red:O1.transparent()});return new q4({children:[new l1({text:new J1("⏺",Y)}),new M0({width:1}),new l1({text:new J1("Replay",Q)})]})}}class qk1 extends j6{entry;constructor({key:J,entry:Q}){super({key:J});this.entry=Q}build(J){let Q=b6.of(J),Y=Q.colors.secondary,X=Q.colors.foreground,G=this.entry.authors.map((Z)=>Z.name).join(", ");return new Q6({decoration:new O8(void 0,new p4(new P4(Y,1,"rounded"),new P4(Y,1,"rounded"),void 0,new P4(Y,1,"rounded"))),child:new c6({padding:f0.horizontal(1),child:new s0({children:[new q4({crossAxisAlignment:"start",children:[new U4({child:new l1({text:new J1(this.entry.title,new z1({color:X,bold:!0}))})}),new M0({width:4}),new l1({text:new J1(G||"Community",new z1({color:X,dim:!0}))})]}),new q4({crossAxisAlignment:"start",children:[new U4({child:new M0({})}),new i2({uri:this.entry.link,text:"View Thread",style:new z1({color:Y,underline:!0}),onError:(Z)=>{}})]})]})})})}}o0();function JD8(J){let Y=new Date().getTime()-J.getTime(),X=Math.floor(Y/3600000),G=Math.floor(X/24),Z=Math.floor(G/7),q=Math.floor(G/30);if(X<1)return"Just now";if(X<24)return`${X}h ago`;if(G<7)return`${G}d ago`;if(Z<=4)return`${Z}w ago`;return`${q}mo ago`}class Vk1{threadHistoryService;constructor(J){this.threadHistoryService=J}async fetchThreadSummaries(J=""){try{let Q=await new Promise((Y)=>{let X=this.threadHistoryService.observeThreadList().subscribe((G)=>{X.unsubscribe(),Y(G)})});return{ok:!0,threads:this.formatThreadSummaries(Q,J)}}catch(Q){return{ok:!1,errorMsg:Q instanceof Error?Q.message:"An unexpected error occurred"}}}observeThreadSummaries(J=""){return this.threadHistoryService.observeHistory().pipe(q6((Q)=>this.formatThreadSummaries(Q,J)))}formatThreadSummaries(J,Q){return J.filter((X)=>{if(!Q.trim())return!0;let G=X.title?.toLowerCase()||"untitled",Z=X.id.toLowerCase(),q=Q.toLowerCase();return G.includes(q)||Z.includes(q)}).map((X)=>{let G=new Date(X.userLastInteractedAt),Z=JD8(G),q=X.id.slice(-8),V=X.env?.initial.trees?.[0]?.uri;return{id:X.id,title:X.title||"Untitled",updatedAt:new Date(X.userLastInteractedAt).toISOString(),description:{timeAgo:Z,title:X.title||"Untitled",shortThreadID:q},diffStats:X.summaryStats?.diffStats,workspaceURI:V,parentRelationships:X.parentRelationships}})}}L0();B9();class Kk1{currentId=null;current=null;subscribeTimer=null;subscription=null;listeners=[];threadService=null;scrollController=new p3;constructor(){}setThreadService(J){this.threadService=J}async select(J){if(!this.threadService){f.error("TUI assert failed: ThreadService used before being set");return}if(this.currentId===J)return;this.cancelTimerAndSubscription(),this.currentId=J;let Q=await this.threadService.get(J);if(Q){if(this.currentId===J)this.current=Q,this.notifyListeners()}this.subscribeTimer=setTimeout(()=>{this.subscribeLive(J)},1000)}clear(){this.cancelTimerAndSubscription(),this.currentId=null,this.current=null,this.notifyListeners()}addListener(J){this.listeners.push(J)}removeListener(J){let Q=this.listeners.indexOf(J);if(Q!==-1)this.listeners.splice(Q,1)}dispose(){this.cancelTimerAndSubscription(),this.scrollController.dispose(),this.listeners=[]}subscribeLive(J){if(!this.threadService){f.error("TUI assert failed: ThreadService used before being set");return}if(this.currentId!==J)return;this.subscription=this.threadService.observePatches(J).pipe(BM()).subscribe((Q)=>{if(this.currentId===J)this.current=Q,this.notifyListeners()})}cancelTimerAndSubscription(){if(this.subscribeTimer)clearTimeout(this.subscribeTimer),this.subscribeTimer=null;if(this.subscription)this.subscription.unsubscribe(),this.subscription=null}notifyListeners(){for(let J of this.listeners)J(this.current)}}function wY6(J,Q){switch(J){case"update-available":return[new J1("A newer Amp is available. Run ",new z1({color:Q.foreground,dim:!0})),new J1("amp update",new z1({color:Q.warning}))];case"updated":return null;case"updated-with-warning":return[new J1("Update complete, run ",new z1({color:Q.foreground,dim:!0})),new J1("amp update",new z1({color:Q.warning})),new J1(" to see warnings",new z1({color:Q.foreground,dim:!0}))];case"update-error":return[new J1("Update failed, run ",new z1({color:Q.foreground,dim:!0})),new J1("amp update",new z1({color:Q.warning})),new J1(" to see warnings",new z1({color:Q.foreground,dim:!0}))];case"hidden":return null}}async function ZD8(J){return new Promise((Q)=>{YD8("git",["branch","--show-current"],{cwd:J},(Y,X)=>{if(Y){Q(null);return}let G=X.trim();Q(G||null)})})}class TY6 extends G6{dependencies;constructor(J){super();this.dependencies=J}createState(){return new RY6}}class RY6 extends X6{themeColors=null;themeApp=null;selectionListener=null;ideStatus=null;connectedClientsStatus=null;connectedClientsStatusExpanded=!1;randomAd=null;adSubscription=null;threadLoadSubscription=null;lastAdImpressionId=null;lastUserInteractionTime=Date.now();isConfirmingExit=!1;isExiting=!1;isConfirmingClearInput=!1;isConfirmingCancelProcessing=!1;copyMessageTimer=null;isShowingHelp=!1;isShowingConsoleOverlay=!1;isShowingConfirmationOverlay=!1;isShowingFileChangesOverlay=!1;isShowingCostBreakdownOverlay=!1;confirmationOverlayContent="";exitConfirmTimeout=null;clearInputConfirmTimeout=null;cancelProcessingConfirmTimeout=null;historyIndex=-1;historyDraft=null;bashInvocations=[];dismissedEphemeralErrorKey=null;currentTitle=void 0;currentShellModeStatus=void 0;imageAttachments=[];displayMessage=null;executingCommand=null;isShowingJetBrainsInstaller=!1;isShowingIdePicker=!1;isShowingPalette=!1;threadsForPicker=[];isLoadingThreads=!1;threadPreviewController=new Kk1;previewThread=null;planScrollController=(()=>{let J=new p3;return J.followMode=!1,J})();todoScrollController=(()=>{let J=new p3;return J.followMode=!1,J})();showingSelectionCopiedHint=!1;isShowingStandaloneThreadPicker=!1;filterThreadPickerByWorkspace=!0;agentModePulseSeq=0;currentGitBranch=null;messageViewFocusNode=new i8({debugLabel:"MessageViewFocus"});autocompleteFocusNode=new i8({debugLabel:"AutocompleteFocus"});isTextfieldAndAutocompleteFocused=!1;submitDisabledHint=null;submitDisabledHintTimer=null;showingCannotToggleMessage=null;showImageUnsupportedHint=!1;imageUnsupportedHintTimer=null;adActionModal=null;threadFeedReader=null;currentThreadFeedEntry=null;threadFeedEntries=[];threadFeedSubscription=null;threadFeedRotationTimer=null;currentUserInfo=null;bottomGridUserHeight=void 0;bottomGridDragStartY=null;bottomGridDragStartHeight=null;pendingMCPServers=[];mcpTrustSubscription=null;agentModeSubscription=null;currentAgentMode="smart";hasToggledAgentMode=!1;inMemoryAgentModeOverride=null;cachedVisibleModes=uG();freeTierStatus=void 0;tryOpus=!1;updateState="hidden";updateServiceSubscription=null;isMessageViewInSelectionMode=!1;threadBackStack=[];threadForwardStack=[];replayDisplayedMessages=[];replayAbortController=new AbortController;replayTypingTimer=null;async initThreadFeed(){let Q=(await M6(this.widget.dependencies.configService.config)).settings.url,Y=Q.includes("localhost")||Q.includes("127.0.0.1");try{let q=await this.widget.dependencies.internalAPIClient.getUserInfo({},{config:this.widget.dependencies.configService});if(q.ok){let V=q.result,K="user"in V?V.user:V;this.currentUserInfo={username:K.username??void 0,displayName:K.displayName??void 0};let W="ffe10a0c-6c42-41ce-a3a6-38990fd6caf8";if(!Y&&V.team?.id!==W)return}else return}catch(q){f.debug("Failed to fetch user info for thread feed filtering",q);return}let X="/threads.rss",G=async(q,V)=>{let K=q instanceof Request?q.url:q.toString();return RQ(K,V,this.widget.dependencies.configService)},Z=fc0();Z.get("entries").then((q)=>{if(q){let V=this.filterEntries(q);if(this.threadFeedEntries=V,V.length>0&&!this.currentThreadFeedEntry)this.setState(()=>{this.currentThreadFeedEntry=this.getRandomEntry(V)})}}),this.threadFeedReader=new jC1(Z,G,{url:X}),this.threadFeedSubscription=this.threadFeedReader.stream().subscribe({next:(q)=>{try{let V=this.filterEntries(q);if(V.length>0)this.threadFeedEntries=[...V,...this.threadFeedEntries],this.setState(()=>{this.currentThreadFeedEntry=V[0]}),this.resetThreadFeedRotation()}catch(V){f.error("Thread feed: error in next handler",V)}},error:(q)=>{f.error("Thread feed error:",q)}}),this.resetThreadFeedRotation()}filterEntries(J){if(!this.currentUserInfo)return J;let{username:Q,displayName:Y}=this.currentUserInfo;return J.filter((X)=>{return!X.authors.some((G)=>{let Z=G.name;if(!Z)return!1;return Q&&Z===Q||Y&&Z===Y||Q&&Z.includes(Q)})})}rotateThreadFeed(){if(this.threadFeedRotationTimer)clearInterval(this.threadFeedRotationTimer);this.threadFeedRotationTimer=setInterval(()=>{if(this.threadFeedEntries.length>0)this.setState(()=>{this.currentThreadFeedEntry=this.getRandomEntry(this.threadFeedEntries)})},30000)}resetThreadFeedRotation(){this.rotateThreadFeed()}getRandomEntry(J){let Y=[...J].sort((X,G)=>G.pubDate.getTime()-X.pubDate.getTime()).slice(0,5);return Y[Math.floor(Math.random()*Y.length)]}recordNavigation(J){this.threadBackStack.push(J),this.threadForwardStack=[]}navigateBack=async()=>{if(this.threadBackStack.length===0)return;let J=this.widget.dependencies.worker.thread.id,Q=this.threadBackStack.pop();this.threadForwardStack.push(J),await this.switchToExistingThread(Q,{recordInNavigationHistory:!1})};navigateForward=async()=>{if(this.threadForwardStack.length===0)return;let J=this.widget.dependencies.worker.thread.id,Q=this.threadForwardStack.pop();this.threadBackStack.push(J),await this.switchToExistingThread(Q,{recordInNavigationHistory:!1})};startAndSwitchToNewThread=async()=>{let J=this.widget.dependencies.worker.thread.id;this.recordNavigation(J);let Q=await this.widget.dependencies.startNewThread();return this.widget.dependencies.worker=Q,this.widget.dependencies.threadID=Q.thread.id,this.widget.dependencies.switchWorker(Q),this.setState(()=>{this.isMessageViewInSelectionMode=!1}),Q};async startReplay(){let J=this.widget.dependencies.replayMode;if(!J)return;let{thread:Q,typingEnabled:Y,baseWpm:X}=J,G=Q.messages;for(let Z=0;Z<G.length;Z++){if(this.replayAbortController.signal.aborted)break;let q=G[Z];if(!q)continue;if(Z>0)await this.replaySleep(J.messageDelayMs);if(q.role==="user"&&Y){let W=q.content.filter((H)=>H.type==="text").map((H)=>H.text).join(`
|
|
4855
4855
|
`);if(W)await this.replayTypeMessage(W,X)}if(q.role==="assistant"){let W=q.content.some((U)=>U.type==="tool_use"),H=G[Z+1],z=H?.role==="user"&&H.content.some((U)=>U.type==="tool_result");if(W&&z){let U={...q,state:{type:"streaming"}};this.setState(()=>{this.replayDisplayedMessages=[...this.replayDisplayedMessages,U],this.textController.clear()});let N=J.thread.id;this.getMessageScrollController(N).scrollToBottom(),await this.replaySleep(J.toolProgressDelayMs),this.setState(()=>{this.replayDisplayedMessages=[...this.replayDisplayedMessages.slice(0,-1),q]});continue}}this.setState(()=>{this.replayDisplayedMessages=[...this.replayDisplayedMessages,q],this.textController.clear()});let V=J.thread.id;this.getMessageScrollController(V).scrollToBottom()}await this.replaySleep(J.exitDelayMs),E9.instance.stop()}async replayTypeMessage(J,Q){this.textController.clear();let Y=J.split(/(?<=\s)/),X=60000/Q;for(let G of Y){if(this.replayAbortController.signal.aborted)break;let Z=X/G.length;for(let q of G){this.textController.text=this.textController.text+q,this.textController.cursorPosition=this.textController.text.length,this.setState(()=>{});let V=0.8+Math.random()*0.4,K=Z*V;await this.replaySleep(K)}}}replaySleep(J){return new Promise((Q)=>{this.replayTypingTimer=setTimeout(Q,J)})}getEffectiveAgentMode(){return S41(this.widget.dependencies.worker.thread,this.inMemoryAgentModeOverride?{agentMode:this.inMemoryAgentModeOverride}:null,this.freeTierStatus,{"experimental.agentMode":this.currentAgentMode})}isProcessing(){let{threadState:J}=this.widget.dependencies;if(!J.mainThread)return!1;if(J.viewState.state!=="active")return!1;if(Boolean(J.viewState.inferenceState==="running"))return!0;let Y=J.items.filter((Z)=>Z.type==="toolResult").filter((Z)=>Z.toolResult.run.status==="in-progress"||Z.toolResult.run.status==="queued"),X=J.subagentActiveTools.filter((Z)=>Z.toolRun.status==="in-progress"||Z.toolRun.status==="queued");return[...Y,...X].length>0}showSubmitDisabledHint(J){if(this.submitDisabledHintTimer)clearTimeout(this.submitDisabledHintTimer);this.setState(()=>{this.submitDisabledHint=J}),this.submitDisabledHintTimer=setTimeout(()=>{this.setState(()=>{this.submitDisabledHint=null}),this.submitDisabledHintTimer=null},3000)}getUIHint(){let J=this.themeColors?.colorScheme;if(!J)return null;let Q=this.themeApp;if(!Q)return null;if(this.submitDisabledHint)return new J1(this.submitDisabledHint,new z1({color:J.foreground,dim:!0}));if(this.isExiting)return new J1("Exiting...",new z1({color:J.foreground,dim:!0}));if(this.isConfirmingExit)return new J1("",void 0,[new J1("Ctrl+C",new z1({color:Q.keybind})),new J1(" again to exit",new z1({color:J.foreground,dim:!0}))]);if(this.isConfirmingClearInput)return new J1("",void 0,[new J1("Esc",new z1({color:Q.keybind})),new J1(" again to clear input",new z1({color:J.foreground,dim:!0}))]);if(this.isShowingHelp)return new J1("",void 0,[new J1("Escape",new z1({color:Q.keybind})),new J1(" to close help",new z1({color:J.foreground,dim:!0}))]);if(this.showImageUnsupportedHint){let G=this.getEffectiveAgentMode(),Z=Fk1(G,this.tryOpus);return new J1("",void 0,[new J1("Images aren't supported in ",new z1({color:J.warning,dim:!1})),new J1(G,new z1({color:Z})),new J1(" mode.",new z1({color:J.warning,dim:!1}))])}if(this.isProcessing()||this.bashInvocations.length>0){if(this.isConfirmingCancelProcessing)return new J1("",void 0,[new J1("Esc",new z1({color:Q.keybind})),new J1(" again to cancel",new z1({color:J.foreground,dim:!0}))]);return new J1("",void 0,[new J1("Esc",new z1({color:Q.keybind})),new J1(" to cancel",new z1({color:J.foreground,dim:!0}))])}if(this.showingSelectionCopiedHint)return new J1("Selection copied to clipboard",new z1({color:J.foreground,dim:!0}));if(this.showingCannotToggleMessage)return new J1(this.showingCannotToggleMessage,new z1({color:J.warning,dim:!1}));let Y=wY6(this.updateState,J);if(Y)return new J1("",void 0,Y);let X=this.widget.dependencies.worker.thread;if(X.agentMode==="plan"&&iA(X))return new J1("",void 0,[new J1("Ctrl+O",new z1({color:Q.keybind})),new J1(" → Execute Plan",new z1({color:J.foreground,dim:!0}))]);return null}isTranscriptEmpty(){let{threadState:J}=this.widget.dependencies;return J.items.length===0}handleMessageRestoreSubmit=async(J)=>{let{threadState:Q,worker:Y}=this.widget.dependencies;if(!Q.mainThread?.id)return;let G=Q.mainThread?.messages.findIndex((Z)=>Z===J);if(G===void 0||G===-1)return;try{this.cancelBashInvocations(),await Y.cancel(),await Y.handle({type:"thread:truncate",fromIndex:G}),this.scrollMessageViewToBottom(),this.setState(()=>{this.imageAttachments=[]})}catch(Z){f.error("Failed to edit message:",Z)}};forkMessage=async(J)=>{let{threadState:Q,workerDeps:Y,threadSyncService:X}=this.widget.dependencies,G=Q.mainThread?.id;if(!G)return;let Z=Q.mainThread?.messages.findIndex((q)=>q===J);if(Z===void 0||Z<=0)return;try{let q=await N3.getOrCreateForThread(Y,G),V=await qR(q,X,Z-1);await this.switchToExistingThread(V)}catch(q){f.error("Failed to fork thread:",q),this.showErrorMessage(`Failed to fork thread: ${q}`)}};handleMessageEditSubmit=async(J,Q)=>{let{threadState:Y,worker:X}=this.widget.dependencies,G=Y.mainThread;if(!G)return;let Z=G.messages.findIndex((q)=>q.messageId!==void 0&&q.messageId===J.messageId);if(Z===-1)return;try{this.cancelBashInvocations(),await X.cancel(),this.widget.dependencies.history.add(Q);let q=YN(Q);if(q)await X.handle({type:"thread:truncate",fromIndex:Z}),this.invokeBashCommand(q.cmd,{visibility:q.visibility});else{let V=[{type:"text",text:Q}];if(this.imageAttachments.length>0)V.push(...this.imageAttachments);let K={content:V,agentMode:G.agentMode},W=Z===0;if(G.agentMode&&!W&&K.agentMode!==G.agentMode){f.error(`Cannot edit message: This thread uses ${G.agentMode} mode. To change mode, create a new thread.`);return}await X.handle({type:"user:message",message:K,index:Z})}this.scrollMessageViewToBottom(),this.setState(()=>{this.imageAttachments=[]})}catch(q){f.error("Failed to edit message:",q)}};getAffectedFiles=async(J)=>{let{worker:Q}=this.widget.dependencies;try{return(await Q.getFilesAffectedByTruncation(J)).map(JJ)}catch(Y){return f.error("Failed to get affected files:",Y),[]}};textController=new hZ;messageScrollControllers=new Map;getMessageScrollController(J){if(!this.messageScrollControllers.has(J))this.messageScrollControllers.set(J,new p3);return this.messageScrollControllers.get(J)}scrollMessageViewToBottom(){let{threadState:J}=this.widget.dependencies,Q=J.mainThread?.id;if(!Q)return;this.getMessageScrollController(Q).scrollToBottom()}findElementByKey(J){return this.searchElementTreeByKey(this.context.element,J)}searchElementTreeByKey(J,Q){if(!J)return null;if(J?.widget?.key?.value===Q)return J;if(J?.child){let X=this.searchElementTreeByKey(J.child,Q);if(X)return X}if(J?.children)for(let X of J.children){let G=this.searchElementTreeByKey(X,Q);if(G)return G}return null}setupSelectionListener(){let J=this.findElementByKey("message-view-selection-area");if(J?.state){let Q=J.state;if(Q?.controller&&!this.selectionListener)this.selectionListener=()=>{this.setState(()=>{})},Q.controller.addListener(this.selectionListener),Q.controller.onSelectionCopied=()=>{if(this.copyMessageTimer)clearTimeout(this.copyMessageTimer);this.setState(()=>{this.showingSelectionCopiedHint=!0}),this.copyMessageTimer=setTimeout(()=>{this.setState(()=>{this.showingSelectionCopiedHint=!1}),this.copyMessageTimer=null},2000)}}}updateTerminalTitle(){let{threadState:J}=this.widget.dependencies,Q=J.mainThread?.title;if(Q!==this.currentTitle){this.currentTitle=Q;let Y=process.cwd().replace(process.env.HOME||"","~"),X=Q?`amp - ${Q} - ${Y}`:"";process.stdout.write(dR1(X))}}_handleTextCopy(J){if(J&&J.length>0){if(this.setState(()=>{this.showingSelectionCopiedHint=!0}),this.copyMessageTimer)clearTimeout(this.copyMessageTimer);this.copyMessageTimer=setTimeout(()=>{this.setState(()=>{this.showingSelectionCopiedHint=!1}),this.copyMessageTimer=null},2000)}}textFieldKey=new n7("text-field");ideStatusSubscription=null;ideMessageSubscription=null;ideAppendToPromptSubscription=null;connectedClientsStatusSubscription=null;paletteCommands=null;completionBuilder=null;textChangeListener=()=>{let J=this.textController.text;if(J==="/"){this.showCommandPalette(),this.textController.clear();return}let Y=YN(J)?.visibility;if(Y!==this.currentShellModeStatus)this.currentShellModeStatus=Y,this.setState(()=>{})};navigateHistoryPrevious=()=>{let J=this.widget.dependencies.history.previous();if(J!==null){if(this.historyIndex===-1)this.historyDraft=this.textController.text;this.historyIndex++,this.textController.text=J,this.textController.moveCursorToStart()}};navigateHistoryNext=()=>{let J=this.widget.dependencies.history.next();if(J!==null)this.historyIndex--,this.textController.text=J,this.textController.moveCursorToEnd();else if(this.historyIndex>-1)this.historyIndex=-1,this.textController.text=this.historyDraft||"",this.textController.moveCursorToEnd(),this.historyDraft=null};resetHistory=()=>{this.widget.dependencies.history.reset(),this.historyIndex=-1,this.historyDraft=null};openJetBrainsInstaller=()=>{this.setState(()=>{this.isShowingJetBrainsInstaller=!0})};dismissJetBrainsInstaller=()=>{this.setState(()=>{this.isShowingJetBrainsInstaller=!1})};openIdePicker=()=>{this.setState(()=>{this.isShowingIdePicker=!0})};dismissIdePicker=()=>{this.setState(()=>{this.isShowingIdePicker=!1}),w9.instance.addPostFrameCallback(()=>{this.autocompleteFocusNode.requestFocus()})};handleIdeSelection=async(J,Q)=>{if(this.widget.dependencies.ideClient.getSelectedConfig()?.pid===J.pid){this.dismissIdePicker();return}try{await this.connectToSelectedIde(J,Q)}catch(Y){let X=Y instanceof Error?Y.message:String(Y);this.setState(()=>{this.displayMessage=Error(`Failed to connect to IDE: ${X}`)})}this.widget.dependencies.ideClient.selectConfig(J),this.dismissIdePicker()};async connectToSelectedIde(J,Q){await this.widget.dependencies.ideClient.start(J,!0,Q)}previewControllerListener=(J)=>{this.setState(()=>{this.previewThread=J})};showStandaloneThreadPicker=()=>{this.loadThreadsForPicker(),this.setState(()=>{this.isShowingStandaloneThreadPicker=!0})};dismissStandaloneThreadPicker=()=>{this.exitApplication()};handleStandaloneThreadSelect=async(J)=>{try{await this.switchToExistingThread(J,{recordInNavigationHistory:!1}),this.threadPreviewController.clear(),this.setState(()=>{this.isShowingStandaloneThreadPicker=!1}),w9.instance.addPostFrameCallback(()=>{if(!this.isMessageViewInSelectionMode&&!this.isShowingPalette&&!this.isShowingStandaloneThreadPicker)this.autocompleteFocusNode.requestFocus()})}catch(Q){f.error("Failed to switch thread:",Q),this.showErrorMessage(`Failed to switch thread: ${Q}`)}};toggleThreadPickerWorkspaceFilter=()=>{this.setState(()=>{this.filterThreadPickerByWorkspace=!this.filterThreadPickerByWorkspace})};showCommandPalette(){if(this.setState(()=>{this.isShowingPalette=!this.isShowingPalette}),this.isShowingPalette)this.loadThreadsForPicker()}getPaletteCommands(){if(!this.paletteCommands)this.paletteCommands=new k_1(this.widget.dependencies.configService,this.widget.dependencies.commandRegistry,(J)=>{this.setState(()=>{this.executingCommand=J})},()=>{this.setState(()=>{this.executingCommand=null})},this.widget.dependencies.isDogfooding);return this.paletteCommands}getCompletionBuilder(){if(!this.completionBuilder)this.completionBuilder=new v_1(this.widget.dependencies.fuzzyServer,this.widget.dependencies.threadFuzzyIndexer);return this.completionBuilder}dismissPalette=()=>{this.setState(()=>{this.isShowingPalette=!1})};getCommandPaletteContext=()=>{let{threadState:J,recentThreadIDs:Q}=this.widget.dependencies;if(!J.mainThread)return null;let Y=n0.file(process.cwd()),X=A6(Y);return{recentThreadIDs:Q,currentThreadID:J.mainThread.id,worker:this.widget.dependencies.worker,editorState:this.textController,isProcessing:this.isProcessing(),thread:J.mainThread,ampURL:this.widget.dependencies.ampURL,threadSyncService:this.widget.dependencies.threadSyncService,configService:this.widget.dependencies.configService,openInEditor:this.openInEditor,takeImageAttachments:()=>{let G=this.imageAttachments;return this.setState(()=>{this.imageAttachments=[]}),G},setImageAttachments:(G)=>{this.setState(()=>{this.imageAttachments=G})},editorDispatch:(G)=>{switch(G.type){case"set-input":this.textController.clear(),this.textController.insertText(G.input);break;case"insert-text":this.textController.insertText(G.text);break;case"clear":this.textController.clear();break}},submitMessage:(G)=>{return this.proceedWithUserMessage(G)},exitApp:this.exitApplication,openHelp:()=>{this.setState(()=>{this.isShowingHelp=!0})},settingsStorage:this.widget.dependencies.settingsStorage,clientId:this.widget.dependencies.clientId,connectedClientsService:this.widget.dependencies.connectedClientsService,mcpService:this.widget.dependencies.mcpService,startNewThread:async()=>{await this.startAndSwitchToNewThread()},navigateBack:this.navigateBack,navigateForward:this.navigateForward,canNavigateBack:this.threadBackStack.length>0,canNavigateForward:this.threadForwardStack.length>0,canUseAmpFree:this.widget.dependencies.freeTierStatus?.canUseAmpFree??!1,switchToThread:async(G)=>{return await this.switchToExistingThread(G),this.setState(()=>{this.isMessageViewInSelectionMode=!1}),this.widget.dependencies.worker},generateHandoffPrompt:async(G,Z,q)=>{let V=this.widget.dependencies.threadState.mainThread?.id;if(!V)throw Error("No active thread");let K=setTimeout(()=>{q.throwIfAborted()},60000);try{let W=await this.widget.dependencies.threadService.generateHandoffPrompt(V,G,Z,this.widget.dependencies.configService,q);return clearTimeout(K),W}catch(W){throw clearTimeout(K),W}},handleHandoff:async(G,Z)=>{let{goal:q,generatedPrompt:V,images:K}=Z;if(!q&&!V)return{ok:!1,error:Error("Either goal or generatedPrompt required")};try{let W=this.widget.dependencies.threadState.mainThread?.id;if(!W)return{ok:!1,error:Error("No active thread")};let H=setTimeout(()=>G.abort(new r81("Handoff took too long and was aborted (timeout: 60s)")),60000);try{let z=await this.widget.dependencies.threadService.createHandoffThread(W,{goal:q,generatedPrompt:V,images:K},this.widget.dependencies.configService,G.signal);return clearTimeout(H),await this.switchToExistingThread(z),{ok:!0}}catch(z){if(clearTimeout(H),z instanceof Error&&(z.name==="AbortError"||z.message.includes("aborted")))throw G.signal.reason;throw z}}catch(W){return f.error("Failed to create handoff thread",W),{ok:!1,error:W instanceof Error?W:Error(String(W))}}},getGuidanceFiles:async(G)=>{if(!J.mainThread)return[];return(await co({filesystem:this.widget.dependencies.worker.fs.fileSystemReader(),configService:this.widget.dependencies.configService,threadService:this.widget.dependencies.threadService},J.mainThread,G)).map((q)=>({uri:q.uri,type:q.type}))},openIdePicker:()=>{this.openIdePicker()},getInMemoryAgentModeOverride:()=>{return this.inMemoryAgentModeOverride},setInMemoryAgentModeOverride:(G)=>{this.setState(()=>{this.inMemoryAgentModeOverride=G,this.hasToggledAgentMode=!0})},toggleAgentMode:this.toggleAgentMode,getEffectiveAgentMode:()=>this.getEffectiveAgentMode(),getEditorText:()=>this.textController.text,workspace:this.widget.dependencies.workspace??null,handleExecutePlan:async()=>{try{let G=J.mainThread?.id;if(!G){this.setState(()=>{this.displayMessage=Error("No active thread")});return}let Z=await this.widget.dependencies.threadService.createPlanExecutionThread(G,"smart");await this.switchToExistingThread(Z)}catch(G){f.error("Failed to execute plan",G),this.setState(()=>{this.displayMessage=Error(`Failed to execute plan: ${G instanceof Error?G.message:String(G)}`)})}},planFileManager:this.widget.dependencies.planFileManager,completionBuilder:this.getCompletionBuilder(),threads:this.threadsForPicker,previewController:this.threadPreviewController,isLoadingThreads:this.isLoadingThreads,filterByWorkspace:this.filterThreadPickerByWorkspace,currentWorkspace:X,threadViewStates:this.widget.dependencies.workerController.threadViewStates,currentThreadFeedEntry:this.currentThreadFeedEntry}};loadThreadsForPicker(){if(this.threadLoadSubscription)return;this.setState(()=>{this.isLoadingThreads=!0});let J=new Vk1(this.widget.dependencies.threadHistoryService);this.threadLoadSubscription=J.observeThreadSummaries("").subscribe({next:(Q)=>{this.setState(()=>{this.threadsForPicker=Q,this.isLoadingThreads=!1})},error:()=>{this.setState(()=>{this.isLoadingThreads=!1})}})}updateGitBranch=async()=>{let J=await ZD8(process.cwd());this.setState(()=>{this.currentGitBranch=J})};removeBashInvocation=(J)=>{this.setState(()=>{this.bashInvocations=this.bashInvocations.filter((Q)=>Q.id!==J)})};invokeBashCommand=(J,{visibility:Q})=>{let Y=Date.now(),X=`bash-${Y}-${Math.random().toString(36).substring(7)}`,G={cmd:J},Z=new AbortController;this.widget.dependencies.worker.invokeBashTool(G,Z.signal,Q===QN).subscribe({next:(q)=>{this.setState(()=>{if(this.bashInvocations.find((K)=>K.id===X))this.bashInvocations=this.bashInvocations.map((K)=>K.id===X?{...K,toolRun:q}:K);else{let K={id:X,args:G,toolRun:q,startTime:Y,abortController:Z,hidden:Q===QN};this.bashInvocations=[...this.bashInvocations,K]}})},error:()=>this.removeBashInvocation(X),complete:()=>this.removeBashInvocation(X)})};cancelBashInvocations=()=>{let J=this.bashInvocations.find((Q)=>Q.toolRun.status==="in-progress");if(J)J.abortController.abort()};toggleConnectedClientsStatus=()=>{this.setState(()=>{this.connectedClientsStatusExpanded=!this.connectedClientsStatusExpanded})};toggleAgentMode=()=>{let J=this.widget.dependencies.getCurrentWorker()||this.widget.dependencies.worker;if(_$(J.thread)>0)return;if(this.freeTierStatus?.canUseAmpFree){let X=this.getEffectiveAgentMode(),G=Pk(X,this.cachedVisibleModes);if(G!==X)this.setState(()=>{this.hasToggledAgentMode=!0,this.inMemoryAgentModeOverride=G,this.agentModePulseSeq++,this.showingCannotToggleMessage=null,this.showImageUnsupportedHint=!1});return}let Q=this.getEffectiveAgentMode(),Y=Pk(Q,this.cachedVisibleModes);if(Y===Q)return;if(this.setState(()=>{this.hasToggledAgentMode=!0,this.inMemoryAgentModeOverride=Y,this.agentModePulseSeq++,this.showingCannotToggleMessage=null,this.showImageUnsupportedHint=!1}),F5(Y))this.checkAndShowFreeModeModal()};checkAndShowFreeModeModal=()=>{if(this.freeTierStatus?.canUseAmpFree)return;if(this.freeTierStatus){if(!this.freeTierStatus.eligible){this.setState(()=>{this.showingCannotToggleMessage="Amp Free is unavailable. Switch to another mode."}),setTimeout(()=>{this.setState(()=>{this.showingCannotToggleMessage=null})},3000);return}else if(!this.freeTierStatus.workspaceAllowsAmpFree){this.setState(()=>{this.showingCannotToggleMessage="Your workspace does not allow Amp Free. Switch to another mode."}),setTimeout(()=>{this.setState(()=>{this.showingCannotToggleMessage=null})},3000);return}}};isInRestrictedFreeMode(){if(this.getEffectiveAgentMode()!=="free")return!1;if(this.freeTierStatus?.canUseAmpFree)return!1;return!0}handleInsertImage=(J)=>{let Q=this.getEffectiveAgentMode();if(!Ik(Q)){if(this.imageUnsupportedHintTimer)clearTimeout(this.imageUnsupportedHintTimer);return this.setState(()=>{this.showImageUnsupportedHint=!0}),this.imageUnsupportedHintTimer=setTimeout(()=>{this.setState(()=>{this.showImageUnsupportedHint=!1}),this.imageUnsupportedHintTimer=null},5000),!1}if(this.imageAttachments.length>=$U)return!1;let Y=FC(J);if(typeof Y==="object")return this.setState(()=>{this.imageAttachments=[...this.imageAttachments,Y]}),!1;return this.setState(()=>{this.displayMessage=Error(`Failed to attach image: ${Y}`)}),!1};handlePopImage=()=>{if(this.imageAttachments.length>0)this.setState(()=>{this.imageAttachments=this.imageAttachments.slice(0,-1)})};openInEditor=async(J)=>{let{mkdtemp:Q,readFile:Y,unlink:X,rmdir:G,writeFile:Z}=await import("node:fs/promises"),{tmpdir:q}=await import("node:os"),V=await import("node:path");try{let K=await Q(V.join(q(),"amp-edit-")),W=V.join(K,"message.amp.md");await Z(W,J,"utf-8"),await Uz(W);try{let H=await Y(W,"utf-8");this.textController.text=H}catch(H){if(H?.code!=="ENOENT")f.error("Failed to read temporary file",H)}try{await X(W),await G(K)}catch(H){f.warn("Failed to clean up temporary file",H)}}catch(K){f.error("Error opening editor:",K)}};onTextSubmitted=async(J)=>{if(!J.trim())return;let Q=YN(J);if(Q)if(!Q.cmd){this.showSubmitDisabledHint("No command provided");return}else if(this.isProcessing()){this.showSubmitDisabledHint("Unable to use shell mode while agent is active");return}else{this.invokeBashCommand(Q.cmd,{visibility:Q.visibility}),this.widget.dependencies.history.add(J),this.textController.clear(),this.resetHistory();return}this.textController.clear(),this.resetHistory(),await this.updateGitBranch(),await this.sendUserMessage(J)};initState(){if(oX.getInstance().interceptConsole(),this.threadPreviewController.setThreadService(this.widget.dependencies.threadService),this.threadPreviewController.addListener(this.previewControllerListener),this.widget.dependencies.openThreadSwitcher)this.showStandaloneThreadPicker();E9.instance.on("key",()=>{this.lastUserInteractionTime=Date.now()}),E9.instance.on("mouse",()=>{this.lastUserInteractionTime=Date.now()}),E9.instance.on("paste",()=>{this.lastUserInteractionTime=Date.now()}),this.autocompleteFocusNode.addListener((Y)=>{w9.instance.addPostFrameCallback(()=>{this.setState(()=>{this.isTextfieldAndAutocompleteFocused=Y.hasFocus})})}),this.freeTierStatus=this.widget.dependencies.freeTierStatus,M6(this.widget.dependencies.configService.config).then((Y)=>{let X=S41(this.widget.dependencies.worker.thread,this.widget.dependencies.sessionState??null,this.freeTierStatus,Y.settings);if(f.info(`[initState] Resolved agentMode: ${X}`),this.widget.dependencies.sessionState?.agentMode)this.setState(()=>{this.inMemoryAgentModeOverride=X})}),this.updateGitBranch(),this.adSubscription=KC1(this.widget.dependencies.internalAPIClient,this.widget.dependencies.configService,()=>{return(this.inMemoryAgentModeOverride&&F5(this.inMemoryAgentModeOverride)||this.randomAd===null)&&VC1(this.lastUserInteractionTime)}).subscribe({next:(Y)=>{if(Y){let X=XD8(16).toString("hex");this.lastAdImpressionId=X,Promise.resolve().then(() => (D91(),N91)).then(({recordAdEvent:G})=>{let Z=this.widget.dependencies.worker.thread,q=Z.messages[Z.messages.length-1];G("viewed",{adId:Y.id,advertiserId:Y.advertiserId,threadId:Z.id,messageId:q?.messageId,impressionId:X,placement:"tui",matchType:Y.metadata?.matchType,matchedPatterns:Y.metadata?.matchedPatterns,candidateAdPoolCount:Y.metadata?.candidateAdPoolCount,clientRegion:Y.metadata?.clientRegion})})}this.setState(()=>{this.randomAd=Y}),w9.instance.addPostFrameCallback(()=>{if(!this.isMessageViewInSelectionMode&&!this.isShowingPalette&&!this.isShowingStandaloneThreadPicker&&!this.isShowingIdePicker)this.autocompleteFocusNode.requestFocus()})}});let{mcpTrustHandler:J}=this.widget.dependencies;this.mcpTrustSubscription=J.pendingServers$.subscribe((Y)=>{this.setState(()=>{this.pendingMCPServers=Y})}),this.ideStatusSubscription=this.widget.dependencies.ideClient.status.subscribe((Y)=>{this.setState(()=>{this.ideStatus=Y})}),this.ideMessageSubscription=this.widget.dependencies.ideClient.messages.subscribe(async(Y)=>{let X=this.widget.dependencies.getCurrentWorker();if(!X){f.warn("No active thread worker found to handle IDE message");return}await new Promise((G)=>setTimeout(G,50)),await X.handle({type:"user:message",message:{content:[{type:"text",text:Y}]}}),f.debug("Message sent from IDE to agent",{message:Y.slice(0,100)})}),this.ideAppendToPromptSubscription=this.widget.dependencies.ideClient.appendToPrompt.subscribe((Y)=>{this.textController.insertText(Y),f.debug("Appended text to CLI prompt from IDE",{text:Y.slice(0,100)})}),this.connectedClientsStatusSubscription=this.widget.dependencies.connectedClientsService.status.subscribe((Y)=>{this.setState(()=>{this.connectedClientsStatus=Y})}),this.updateServiceSubscription=this.widget.dependencies.updateService.state.subscribe((Y)=>{this.setState(()=>{this.updateState=Y})}),this.agentModeSubscription=this.widget.dependencies.configService.config.subscribe((Y)=>{let X=uG(Y.settings,this.freeTierStatus?.canUseAmpFree);this.setState(()=>{this.cachedVisibleModes=X,this.tryOpus=Y.settings.tryOpus??!1})}),this.textController.addListener(this.textChangeListener),this.updateTerminalTitle();let Q=this.widget.dependencies.ideClient.getSelectedConfig();if(Q)this.connectToSelectedIde(Q,"auto-startup").catch((Y)=>{let X=Y instanceof Error?Y.message:String(Y);this.setState(()=>{this.displayMessage=Error(`Failed to connect to IDE: ${X}`)})});else if(this.widget.dependencies.showIdePicker)this.openIdePicker();else if(this.widget.dependencies.showJetBrainsInstaller)this.openJetBrainsInstaller();if(this.widget.dependencies.replayMode)setTimeout(()=>this.startReplay(),100);this.initThreadFeed()}didUpdateWidget(J){super.didUpdateWidget(J),this.setupSelectionListener()}dispose(){if(this.replayAbortController.abort(),this.replayTypingTimer)clearTimeout(this.replayTypingTimer);if(this.ideStatusSubscription)this.ideStatusSubscription.unsubscribe();if(this.ideMessageSubscription)this.ideMessageSubscription.unsubscribe();if(this.ideAppendToPromptSubscription)this.ideAppendToPromptSubscription.unsubscribe();if(this.connectedClientsStatusSubscription)this.connectedClientsStatusSubscription.unsubscribe();if(this.updateServiceSubscription)this.updateServiceSubscription.unsubscribe();if(this.agentModeSubscription)this.agentModeSubscription.unsubscribe();if(this.adSubscription)this.adSubscription.unsubscribe();if(this.mcpTrustSubscription)this.mcpTrustSubscription.unsubscribe();if(this.threadLoadSubscription)this.threadLoadSubscription.unsubscribe();if(this.threadFeedSubscription)this.threadFeedSubscription.unsubscribe();if(this.threadFeedRotationTimer)clearInterval(this.threadFeedRotationTimer);if(this.threadPreviewController.removeListener(this.previewControllerListener),this.threadPreviewController.dispose(),this.exitConfirmTimeout)clearTimeout(this.exitConfirmTimeout),this.exitConfirmTimeout=null;if(this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout),this.clearInputConfirmTimeout=null;this.textController.removeListener(this.textChangeListener);for(let J of this.messageScrollControllers.values())J.dispose();if(this.messageScrollControllers.clear(),process.stdout.write(dR1("")),this.shouldUseProgressBar())process.stdout.write(C96())}getCurrentConfirmation(){let{threadState:J}=this.widget.dependencies,X=[...J.items.filter((V)=>V.type==="toolResult").map((V)=>({toolUse:V.toolUse,toolRun:V.toolResult.run,subthreadID:void 0})),...J.subagentActiveTools].filter((V)=>V.toolRun.status==="blocked-on-user");if(X.length===0)return null;let G=X[0],Z=G.toolRun.status==="blocked-on-user"?G.toolRun.toAllow??[]:[],q=G.toolRun.status==="blocked-on-user"?G.toolRun.reason:void 0;return{type:"tool-use",tools:[{useBlock:G.toolUse,toAllow:Z}],subthreadID:G.subthreadID,reason:q}}shouldUseProgressBar(){return!1}updateProgressBar(){}onConfirmationResponse=async(J)=>{let Q=this.getCurrentConfirmation();if(!Q||Q.type!=="tool-use"){f.error("No current tool confirmation found");return}let Y=Q.tools[0]?.useBlock;if(!Y){f.error("No tool use block found in confirmation");return}if(J==="allow-all-session")hG("dangerouslyAllowAll",!0);if(J==="allow-all-persistent")try{await this.widget.dependencies.settingsStorage.set("dangerouslyAllowAll",!0,"global")}catch(G){if(G&&G instanceof Error)this.setState(()=>{this.displayMessage=G});else f.error("Failed to write dangerouslyAllowAll setting:",G);return}if(J==="always-guarded"){let G=Q.tools[0]?.toAllow??[],Z=await this.widget.dependencies.settingsStorage.get("guardedFiles.allowlist")||[],q=[...G,...Z];await this.widget.dependencies.settingsStorage.set("guardedFiles.allowlist",q,"global")}if(J==="connect-github"){let G=new URL("/settings#code-host-connections",this.widget.dependencies.ampURL).toString();try{await YJ(G)}catch(Z){f.error("Failed to open settings page:",Z),await this.showErrorMessage(`Cannot open browser. Please go to ${G} to connect to GitHub`)}return}if(J==="disable-librarian"){let G=await this.widget.dependencies.settingsStorage.get("tools.disable")??[];if(!G.includes(NX))await this.widget.dependencies.settingsStorage.set("tools.disable",[...G,NX],"global")}let X=J!==null&&["yes","allow-all-session","allow-all-persistent","always-guarded"].includes(J);try{let G={type:"user:tool-input",toolUse:Y.id,value:{accepted:X}};if(Q.subthreadID)await(await N3.getOrCreateForThread(this.widget.dependencies.workerDeps,Q.subthreadID)).handle(G);else await this.widget.dependencies.worker.handle(G)}catch(G){f.error("Failed to send tool confirmation:",G)}};showConfirmationOverlay=(J)=>{this.setState(()=>{this.isShowingConfirmationOverlay=!0,this.confirmationOverlayContent=J})};getErrorKey(J){return`${J.constructor.name}:${J.message}`}getCurrentEphemeralError(){let{threadState:J}=this.widget.dependencies,Q=J.viewState;if(Q.state!=="active"||!Q.ephemeralError)return null;let Y=this.getErrorKey(Q.ephemeralError);if(this.dismissedEphemeralErrorKey===Y)return null;return Q.ephemeralError}handleEphemeralErrorResponse=async(J)=>{let Q=this.getCurrentEphemeralError(),Y=this.widget.dependencies.worker;switch(J){case"retry":this.dismissedEphemeralErrorKey=null,await Y.retry();break;case"dismiss":if(Q)this.dismissedEphemeralErrorKey=this.getErrorKey(Q);break;case"new-thread":{this.setState(()=>{this.dismissedEphemeralErrorKey=null}),await this.startAndSwitchToNewThread();break}case"new-smart-thread":{this.setState(()=>{this.inMemoryAgentModeOverride="smart",this.dismissedEphemeralErrorKey=null}),h61({agentMode:"smart"}),await this.startAndSwitchToNewThread();break}}this.setState(()=>{})};handleDisplayMessageDismiss=()=>{this.setState(()=>{this.displayMessage=null})};handleMCPTrustOpenSettings=async()=>{let{mcpTrustHandler:J,settingsStorage:Q}=this.widget.dependencies;await J.deny();try{await Uz(Q.getSettingsFilePath())}catch(Y){let X=Y instanceof Error?Y.message:String(Y);await this.showErrorMessage(`Failed to open settings: ${X}`)}};cancelStreamingMessage=async()=>{await N3.cancel(this.widget.dependencies.threadID)};markLastUserMessageAsInterrupted=async()=>{let J=this.widget.dependencies.threadState.mainThread;if(!J)return;for(let Q=J.messages.length-1;Q>=0;Q--){let Y=J.messages[Q];if(Y?.role==="user"&&!Y.interrupted){await this.widget.dependencies.worker.handle({type:"user:message:interrupt",messageIndex:Q});break}}};switchToExistingThread=async(J,Q={})=>{let{recordInNavigationHistory:Y=!0}=Q;if(Y){let X=this.widget.dependencies.worker.thread.id;if(X!==J)this.recordNavigation(X)}try{f.info(`[switchToExistingThread] Switching to thread: ${J}`);let X=await this.widget.dependencies.switchToThread(J);f.info(`[switchToExistingThread] Got worker for thread ${J}, thread.agentMode: ${X.thread.agentMode}`);let G=await this.widget.dependencies.configService.getLatest(),Z=S41(X.thread,this.widget.dependencies.sessionState??null,this.freeTierStatus,G.settings);if(f.info(`[switchToExistingThread] Thread ${J} resolved agentMode: ${Z}`),this.widget.dependencies.worker=X,this.widget.dependencies.threadID=X.thread.id,this.widget.dependencies.switchWorker(X),this.setState(()=>{f.info("[switchToExistingThread] Clearing inMemoryAgentModeOverride"),this.inMemoryAgentModeOverride=null}),X.thread.draft)if(f.info("[switchToExistingThread] Loading draft content into text controller"),this.textController.clear(),typeof X.thread.draft==="string")this.textController.insertText(X.thread.draft);else{let q=X.thread.draft.filter((W)=>W.type==="text"),V=X.thread.draft.filter((W)=>W.type==="image"),K=q.map((W)=>W.text).join(`
|
|
4856
4856
|
`);if(K)this.textController.insertText(K);if(V.length>0)this.setState(()=>{this.imageAttachments=V})}}catch(X){throw f.error("Failed to switch to thread:",J,X),Error(`Failed to switch to thread: ${J}`)}};sendUserMessage=async(J)=>{await this.proceedWithUserMessage(J)};proceedWithUserMessage=async(J)=>{this.cancelBashInvocations(),this.widget.dependencies.history.add(J);let Q=this.widget.dependencies.getCurrentWorker()||this.widget.dependencies.worker,Y=_$(Q.thread)===0,X=this.getEffectiveAgentMode();if(Q.thread.agentMode&&!Y&&X!==Q.thread.agentMode){await this.showErrorMessage(`This thread uses ${Q.thread.agentMode} mode. To change mode, edit the first message or create a new thread.`);return}let G=[{type:"text",text:J}];if(this.imageAttachments.length>0)G.push(...this.imageAttachments);if(await Q.handle({type:"user:message",message:{content:G,agentMode:X}}),Y)h61({agentMode:X});this.scrollMessageViewToBottom(),this.setState(()=>{this.imageAttachments=[]}),w9.instance.addPostFrameCallback(()=>{if(!this.isMessageViewInSelectionMode&&!this.isShowingPalette&&!this.isShowingStandaloneThreadPicker&&!this.isShowingIdePicker)this.autocompleteFocusNode.requestFocus()})};async showErrorMessage(J){this.setState(()=>{this.displayMessage=Error(J)})}exitApplication=async()=>{this.setState(()=>{this.isExiting=!0});let J=this.widget.dependencies.threadState.mainThread;if(J?.messages.length===0){if(J.relationships?.find((X)=>X.type==="handoff"&&X.role==="child"))await this.widget.dependencies.threadService.discardHandoffThread(J.id).catch(()=>{})}let Q=this.getEffectiveAgentMode();h61({agentMode:Q}).catch((Y)=>{f.warn("Failed to save session state on exit:",Y)}).finally(()=>{E9.instance.stop()})};onExitPressed=()=>{if(this.isConfirmingExit){if(this.exitConfirmTimeout)clearTimeout(this.exitConfirmTimeout),this.exitConfirmTimeout=null;this.exitApplication()}else{if(this.setState(()=>{this.isConfirmingExit=!0}),this.exitConfirmTimeout)clearTimeout(this.exitConfirmTimeout);this.exitConfirmTimeout=setTimeout(()=>{this.setState(()=>{this.isConfirmingExit=!1}),this.exitConfirmTimeout=null},1000)}};toHomeRelative(J){let Q=GD8();if(J===Q)return"~";if(J.startsWith(Q+Pm.sep))return"~"+J.slice(Q.length);return J}shorten(J){let Q=J.split(Pm.sep).filter(Boolean);if(Q.length<=5)return J;return[Q.slice(0,2).join(Pm.sep),"…",Q.slice(-2).join(Pm.sep)].join(Pm.sep)}build(J){let Q=U8.of(J),Y=b6.of(J),X=Y.base;this.themeColors=X;let{colors:G,app:Z}=Y;this.themeApp=Z;let q=this.widget.dependencies.getCurrentWorker()||this.widget.dependencies.worker,V=q.thread.agentMode&&F5(q.thread.agentMode),K=V&&this.randomAd!==null,W=!V&&this.currentThreadFeedEntry!==null,H=K||W,{threadState:z}=this.widget.dependencies;this.updateTerminalTitle(),this.updateProgressBar();let U=this.getCurrentConfirmation(),N=this.widget.dependencies.replayMode,M=Boolean(N),L=z.items,A=z.mainThread||void 0,E=z.subagentToolsByParentID,P=z.todosList;if(M){let d6={...N.thread,messages:this.replayDisplayedMessages};L=SC(d6).items,A=d6,E={};let _4=JI({messages:this.replayDisplayedMessages});P=Array.isArray(_4)?_4:[]}let I=A?.id,R=A,S=M?this.replayDisplayedMessages.length===0:this.isTranscriptEmpty(),y=(d6)=>new n81({key:new n7(`preview-message-view-${d6.id}`),items:SC(d6).items,controller:this.threadPreviewController.scrollController,autofocus:!1,thread:d6,focusNode:new i8({debugLabel:"PreviewFocus"})}),h=this.previewThread,u=h?h.messages.length>2000?new s0({mainAxisSize:"max",children:[new U4({child:new M0}),new c6({padding:f0.all(2),child:new H8({child:new l1({text:new J1("Thread too long for preview",new z1({color:G.mutedForeground,dim:!0}))})})})]}):y(h):S?new o81({agentMode:this.getEffectiveAgentMode(),tryOpus:this.tryOpus}):new n81({key:I?new n7(`message-view-${I}`):void 0,items:L,subagentToolsByParentID:E,controller:I?this.getMessageScrollController(I):new p3,autofocus:!1,onCopy:M?void 0:this._handleTextCopy.bind(this),thread:R,onMessageEditSubmit:M?void 0:this.handleMessageEditSubmit,onMessageRestoreSubmit:M?void 0:this.handleMessageRestoreSubmit,onMessageForkSubmit:M?void 0:this.forkMessage,getAffectedFiles:M?void 0:this.getAffectedFiles,focusNode:this.messageViewFocusNode,onDismissFocus:()=>{if(this.setState(()=>{this.isMessageViewInSelectionMode=!1}),!this.isShowingIdePicker)this.autocompleteFocusNode.requestFocus()},isInSelectionMode:this.isMessageViewInSelectionMode}),p=Math.max(Math.floor(Q.size.height*0.4),12),g=this.getCurrentEphemeralError(),i=this.buildBottomWidget(g,U,G,Y,z,P,p,H,M),Y1=Q.size.width<40,a=z.mainThread?mU0(z.mainThread):void 0,b=new K81({threadViewState:z.viewState,threadTokenUsage:a,threadID:I??null,thread:z.mainThread??void 0,onFileChangesClick:()=>{this.setState(()=>{this.isShowingFileChangesOverlay=!this.isShowingFileChangesOverlay})},onCostBreakdownClick:()=>{this.setState(()=>{this.isShowingCostBreakdownOverlay=!this.isShowingCostBreakdownOverlay})},onShowIdePicker:this.openIdePicker,ideStatus:this.ideStatus,connectedClientsStatus:this.connectedClientsStatus,isNarrow:Y1,uiHint:this.getUIHint()??void 0,waitingForConfirmation:!!U,showingEphemeralError:Boolean(z.viewState.state==="active"&&z.viewState.ephemeralError),runningBashInvocations:this.bashInvocations.length>0,executingCommand:this.executingCommand?.name??null,executingCommandMessage:this.executingCommand?.statusMessage??null}),s=new V81({bashInvocations:this.bashInvocations}),q1=[],K1=this.getEffectiveAgentMode(),o=this.currentShellModeStatus,r=Fk1(K1,this.tryOpus),l=!o?K1.length+1:0,F1=Q.capabilities.animationSupport,y1=F1==="disabled"?0:F1==="slow"?30:60,t=gW(K1)?.uiHints?.fasterAnimation?3:1,f1=y1>0&&this.agentModePulseSeq>0?new e5({children:[i,new u3({top:0,left:1,right:1,height:1,child:new Xk1({color:r,trigger:this.agentModePulseSeq,fps:y1,speed:t,leftOffset:l})})]}):i;q1.push(new U4({child:u}),s);let j1=new e5({children:[new s0({mainAxisSize:"min",children:[K?new E_1({ad:this.randomAd,onButtonClick:async()=>{let d6=this.randomAd;if(this.lastAdImpressionId)Promise.resolve().then(() => (D91(),N91)).then(({recordAdEvent:_4})=>{let l4=this.widget.dependencies.worker.thread,u4=l4.messages[l4.messages.length-1];_4("clicked",{adId:d6.id,advertiserId:d6.advertiserId,threadId:l4.id,messageId:u4?.messageId,impressionId:this.lastAdImpressionId,placement:"tui",actionType:"link_to",matchType:d6.metadata?.matchType,matchedPatterns:d6.metadata?.matchedPatterns,candidateAdPoolCount:d6.metadata?.candidateAdPoolCount,clientRegion:d6.metadata?.clientRegion})});try{await YJ(d6.shortDestinationUrl)}catch(_4){let u4=E9.instance.tuiInstance.clipboard.isOsc52Supported();this.setState(()=>{this.adActionModal={showCopyOption:u4,url:d6.shortDestinationUrl}})}}}):W?new qk1({entry:this.currentThreadFeedEntry}):new M0({height:0}),new Q6({constraints:new r6(0,Q.size.width,0,p),child:f1})]}),H?new u3({top:0,left:0,right:0,child:new SY6({userHeight:this.bottomGridUserHeight,maxHeight:p,onInitializeHeight:(d6)=>{this.setState(()=>{this.bottomGridUserHeight=Math.min(d6,p)})},onDrag:(d6)=>{if(this.bottomGridDragStartY===null)this.bottomGridDragStartY=Math.floor(d6.localPosition.y),this.bottomGridDragStartHeight=this.bottomGridUserHeight;let _4=Math.floor(d6.localPosition.y)-this.bottomGridDragStartY,l4=Math.max(4,this.bottomGridDragStartHeight-_4),u4=Math.min(l4,p),w4=Math.floor(u4);if(this.bottomGridUserHeight!==w4)this.setState(()=>{this.bottomGridUserHeight=w4})},onRelease:()=>{this.bottomGridDragStartY=null,this.bottomGridDragStartHeight=null}})}):new M0({height:0})]});q1.push(j1,new M0({height:1,child:new c6({padding:f0.horizontal(1),child:b})}));let w0=new s0({crossAxisAlignment:"stretch",mainAxisSize:"max",children:q1}),C1=M?new e5({children:[w0,new u3({top:0,left:0,child:new $k1})]}):w0,s1=new Q9(()=>{if(this.isShowingPalette)return this.dismissPalette(),"handled";if(this.pendingMCPServers.length>0)return this.widget.dependencies.mcpTrustHandler.deny(),"handled";if(this.getCurrentEphemeralError())return this.handleEphemeralErrorResponse("dismiss"),"handled";if(this.displayMessage)return this.handleDisplayMessageDismiss(),"handled";if(this.isShowingHelp)return this.setState(()=>{this.isShowingHelp=!1}),"handled";if(this.isShowingFileChangesOverlay)return this.setState(()=>{this.isShowingFileChangesOverlay=!1}),"handled";if(this.isShowingCostBreakdownOverlay)return this.setState(()=>{this.isShowingCostBreakdownOverlay=!1}),"handled";if(this.isShowingIdePicker)return this.dismissIdePicker(),"handled";if(this.isShowingJetBrainsInstaller)return this.dismissJetBrainsInstaller(),"handled";if(this.isShowingConfirmationOverlay)return this.setState(()=>{this.isShowingConfirmationOverlay=!1,this.confirmationOverlayContent=""}),"handled";if(this.isShowingConsoleOverlay)return this.setState(()=>{this.isShowingConsoleOverlay=!1}),"handled";if(this.textController.hasSelection)return this.textController.clearSelection(),"handled";if(this.isConfirmingClearInput){if(this.textController.clear(),this.setState(()=>{this.isConfirmingClearInput=!1,this.imageAttachments=[]}),this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout),this.clearInputConfirmTimeout=null;return"handled"}if(this.isConfirmingCancelProcessing){if(this.bashInvocations.length>0)this.cancelBashInvocations();if(this.isProcessing())this.markLastUserMessageAsInterrupted().catch((_4)=>{f.error("Failed to mark message as interrupted:",_4)}),this.cancelStreamingMessage().catch((_4)=>{f.error("Failed to cancel streaming message:",_4)});if(this.setState(()=>{this.isConfirmingCancelProcessing=!1}),this.cancelProcessingConfirmTimeout)clearTimeout(this.cancelProcessingConfirmTimeout),this.cancelProcessingConfirmTimeout=null;return"handled"}if(this.executingCommand)return f.info("Canceling executing command:",this.executingCommand.name),this.executingCommand.abortController.abort(),"handled";if(this.bashInvocations.length>0||this.isProcessing()){if(this.setState(()=>{this.isConfirmingCancelProcessing=!0}),this.cancelProcessingConfirmTimeout)clearTimeout(this.cancelProcessingConfirmTimeout);return this.cancelProcessingConfirmTimeout=setTimeout(()=>{this.setState(()=>{this.isConfirmingCancelProcessing=!1}),this.cancelProcessingConfirmTimeout=null},1000),"handled"}if(this.textController.text.trim()!==""||this.imageAttachments.length>0){if(this.setState(()=>{this.isConfirmingClearInput=!0}),this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout);return this.clearInputConfirmTimeout=setTimeout(()=>{this.setState(()=>{this.isConfirmingClearInput=!1}),this.clearInputConfirmTimeout=null},1000),"handled"}return"ignored"}),U1=new Q9(()=>{return this.onExitPressed(),"handled"}),Q1=new Q9(()=>{return this.setState(()=>{this.isShowingConsoleOverlay=!this.isShowingConsoleOverlay}),"handled"}),A1=new Q9(()=>{return OJ.instance.toggleAll(),"handled"}),w1=new Q9(()=>{return this.widget.dependencies.configService.getLatest().then((d6)=>{hG("internal.showCost",!(d6.settings["internal.showCost"]??!0))}),"handled"}),I1=new Q9(()=>{return E9.instance.toggleFrameStatsOverlay(),"handled"}),E1=new Q9(()=>{return E9.instance.tuiInstance.getScreen().markForRefresh(),w9.instance.requestFrame(),"handled"}),p1=new Q9(()=>{return this.toggleAgentMode(),"handled"}),h1=new Q9(()=>{let _4=this.isShowingPalette&&this.previewThread?this.threadPreviewController.scrollController:(()=>{let{threadState:l4}=this.widget.dependencies,u4=l4.mainThread?.id;return u4?this.getMessageScrollController(u4):null})();if(_4){let l4=Math.max(Math.floor(Q.size.height*0.4),10),u4=Q.size.height-l4;_4.animatePageUp(u4,100)}return"handled"}),r1=new Q9(()=>{let _4=this.isShowingPalette&&this.previewThread?this.threadPreviewController.scrollController:(()=>{let{threadState:l4}=this.widget.dependencies,u4=l4.mainThread?.id;return u4?this.getMessageScrollController(u4):null})();if(_4){let l4=Math.max(Math.floor(Q.size.height*0.4),10),u4=Q.size.height-l4;_4.animatePageDown(u4,100)}return"handled"}),$0=new Q9(()=>{let _4=this.isShowingPalette&&this.previewThread?this.threadPreviewController.scrollController:(()=>{let{threadState:l4}=this.widget.dependencies,u4=l4.mainThread?.id;return u4?this.getMessageScrollController(u4):null})();if(_4)_4.animateTo(0,100);return"handled"}),G0=new Q9(()=>{let _4=this.isShowingPalette&&this.previewThread?this.threadPreviewController.scrollController:(()=>{let{threadState:l4}=this.widget.dependencies,u4=l4.mainThread?.id;return u4?this.getMessageScrollController(u4):null})();if(_4)_4.animateTo(Number.MAX_SAFE_INTEGER,100);return"handled"}),R0=new Q9(()=>{if(!this.isTextfieldAndAutocompleteFocused)return"ignored";let{threadState:d6}=this.widget.dependencies;if(!d6.mainThread?.messages.some((l4)=>l4.role==="user"||eE(l4)))return"ignored";return this.setState(()=>{this.isMessageViewInSelectionMode=!0}),"handled"}),F6=new Q9((d6)=>{if(d6.direction==="previous")this.navigateHistoryPrevious();else this.navigateHistoryNext();return"handled"}),D6=new Q9(()=>{if(!this.isTextfieldAndAutocompleteFocused)return"ignored";return X81().then(async(d6)=>{if(d6)try{this.handleInsertImage(d6)}finally{try{let{unlink:_4}=await import("node:fs/promises");await _4(d6)}catch{}}}),"handled"}),N4=new Map([[B4.ctrl("c"),new eg],[B4.ctrl("l"),new Gm],[B4.ctrl("o"),new n41],[B4.ctrl("v"),new sg],[B4.alt("s"),new BC],[B4.ctrl("s"),new BC],[B4.alt("p"),new Xm],[B4.ctrl("r"),new Qm],[B4.alt("d"),new Ym],[B4.ctrl("t"),new Zm],[B4.key("PageUp"),new d41],[B4.key("PageDown"),new c41],[B4.key("Home"),new l41],[B4.key("End"),new i41],[B4.key("Escape"),new tg],[B4.ctrl("p"),new NC("previous")],[B4.ctrl("n"),new NC("next")],[B4.key("Tab"),new $m]]);if(!c2())N4.set(B4.key("ArrowUp"),new $m);if(!1)N4.set(B4.alt("c"),new Jm);let S9=new Q9(()=>{if(this.isShowingStandaloneThreadPicker)return"handled";return this.showCommandPalette(),"handled"}),I0=new Q9(()=>{return this.toggleThreadPickerWorkspaceFilter(),"handled"}),u0=new Map([[tg,s1],[Gm,E1],[BC,p1],[n41,S9],[sg,D6],[Jm,Q1],[Qm,A1],[Ym,w1],[Xm,I1],[Zm,I0],[eg,U1],[d41,h1],[c41,r1],[l41,$0],[i41,G0],[$m,R0],[NC,F6]]),_6=[C1];if(this.isShowingConsoleOverlay)_6.push(new b_1);if(this.isShowingHelp){let d6=this.getPaletteCommands().getAllCommands();_6.push(new u_1({commands:d6}))}if(this.adActionModal)_6.push(new I_1({title:"Failed to open browser",message:this.adActionModal.url,showCopyOption:this.adActionModal.showCopyOption,onSelect:async(d6)=>{let _4=this.adActionModal.url;if(d6==="copy")try{await E9.instance.tuiInstance.clipboard.writeText(_4),this.setState(()=>{this.displayMessage=new QG("Link copied to clipboard")})}catch(l4){f.error("Failed to copy to clipboard",{error:l4}),this.setState(()=>{this.displayMessage=Error("Failed to copy to clipboard")})}this.setState(()=>{this.adActionModal=null})}}));if(this.pendingMCPServers.length>0){let{mcpTrustHandler:d6}=this.widget.dependencies;_6.push(new Gk1({servers:this.pendingMCPServers,onAlwaysTrust:d6.trustAlways.bind(d6),onTrustOnce:d6.trustOnce.bind(d6),onOpenSettings:this.handleMCPTrustOpenSettings,onDismiss:d6.deny.bind(d6)}))}if(this.isShowingFileChangesOverlay)_6.push(new Pj1({threadData:z}));if(this.isShowingCostBreakdownOverlay&&z.mainThread)_6.push(new g_1({thread:z.mainThread}));if(this.isShowingConfirmationOverlay)_6.push(new f_1({details:this.confirmationOverlayContent}));let Q8=this.getCommandPaletteContext();if(Q8&&this.isShowingPalette)_6.push(new H8({child:new Q6({constraints:r6.loose(80,20),child:new x_1({commandContext:Q8,mainThread:z.mainThread,commands:this.getPaletteCommands(),onDismiss:this.dismissPalette})})}));if(this.isShowingIdePicker)_6.push(new d_1({onCancel:this.dismissIdePicker,onSelect:this.handleIdeSelection,jetbrainsMode:this.widget.dependencies.jetbrainsMode}));if(this.isShowingStandaloneThreadPicker){let d6=n0.file(process.cwd()),_4=A6(d6);_6.push(new H8({child:new Q6({constraints:r6.loose(80,20),child:new OC({threads:this.threadsForPicker,title:"Continue Thread",onSelect:this.handleStandaloneThreadSelect,onDismiss:this.dismissStandaloneThreadPicker,previewController:this.threadPreviewController,isLoading:this.isLoadingThreads,currentWorkspaceURI:_4,filterByWorkspace:this.filterThreadPickerByWorkspace,threadViewStates:this.widget.dependencies.workerController.threadViewStates,recentThreadIDs:this.widget.dependencies.recentThreadIDs,currentThreadID:this.widget.dependencies.threadState.mainThread?.id})})}))}let y8=new e5({children:_6});if(this.isShowingJetBrainsInstaller)return new YO({child:new cQ({actions:u0,child:new Pq({shortcuts:N4,debugLabel:"jetbrains-installer-shortcuts",child:new Yk1({configService:this.widget.dependencies.configService,ideClient:this.widget.dependencies.ideClient,onExit:()=>process.exit(0),onContinue:this.dismissJetBrainsInstaller})})})});let N5=new XN({onError:(d6)=>{this.showErrorMessage(d6.message)},child:y8});return new YO({child:new cQ({actions:u0,child:new Pq({shortcuts:N4,debugLabel:"main-app-shortcuts",child:N5})})})}buildScrollableTodoList(J,Q,Y){return new CY6({todos:J,enabled:Q,controller:this.todoScrollController,appTheme:Y})}buildBottomWidget(J,Q,Y,X,G,Z,q,V,K){if(J)return new m_1({error:J,ampURL:this.widget.dependencies.ampURL,onResponse:this.handleEphemeralErrorResponse});if(Q){if(this.displayMessage)this.handleDisplayMessageDismiss();return new h_1({confirmationRequest:Q,onResponse:this.onConfirmationResponse,onShowOverlay:this.showConfirmationOverlay})}if(this.displayMessage)return new Zk1({message:this.displayMessage,onDismiss:this.handleDisplayMessageDismiss});let W=X.app,H=q81(X),z=this.isInRestrictedFreeMode(),U=new MO({key:this.textFieldKey,controller:this.textController,triggers:K?[]:[new WN],completionBuilder:K?void 0:this.getCompletionBuilder(),ampURL:this.widget.dependencies.ampURL,onSubmitted:K?void 0:this.onTextSubmitted,theme:Y,placeholder:K?"Press Ctrl+C to exit":z?"Amp Free is not enabled. Press Ctrl+S to switch modes.":void 0,enabled:this.isTextfieldAndAutocompleteFocused&&!z&&!this.isShowingStandaloneThreadPicker,shellPromptRules:H,focusNode:this.autocompleteFocusNode,autofocus:!this.isMessageViewInSelectionMode&&!this.isShowingStandaloneThreadPicker&&!this.isShowingIdePicker,clipboard:E9.instance.tuiInstance.clipboard,onCopy:this._handleTextCopy.bind(this),onInsertImage:this.handleInsertImage,imageAttachments:this.imageAttachments,popImage:this.handlePopImage}),N=G.mainThread?.queuedMessages??[],M=Array.isArray(Z)&&Z.length>0,L=Array.isArray(N)&&N.length>0,A=G.mainThread?.agentMode==="plan"&&iA(G.mainThread),E,P;if(A){if(E=new aC1(new a81({thread:G.mainThread,onExecute:async()=>{let g=this.getCommandPaletteContext();if(g)await this.getPaletteCommands().execute("execute-plan",g,void 0,new AbortController)},onEdit:async()=>{try{let g=process.env.EDITOR||process.env.VISUAL||"nano",{filePath:i}=await this.widget.dependencies.planFileManager.ensureSync(G.mainThread.id);E9.instance.tuiInstance.suspend();let{execSync:Y1}=await import("child_process");Y1(`${g} "${i}"`,{stdio:"inherit"}),E9.instance.tuiInstance.resume()}catch(g){f.error("Failed to edit plan",g),this.setState(()=>{this.displayMessage=Error("Failed to edit plan")})}},controller:this.planScrollController,appTheme:X}),{clipBehavior:"antiAlias"}),L)P=new B91({queuedMessages:N});else if(M)P=this.buildScrollableTodoList(Z,this.isTextfieldAndAutocompleteFocused&&!z,X)}else E=L?new B91({queuedMessages:N}):void 0,P=M?this.buildScrollableTodoList(Z,this.isTextfieldAndAutocompleteFocused&&!z,X):void 0;let I=[],R=this.currentShellModeStatus;if(R)I.push({text:new J1(R==="hidden"?"shell mode (incognito)":"shell mode",new z1({color:R==="hidden"?X.app.shellModeHidden:X.app.shellMode})),position:"top-left"});if(!R&&this.cachedVisibleModes.length>1){let g=this.previewThread,i=g?g.agentMode??this.getEffectiveAgentMode():this.getEffectiveAgentMode(),Y1=Fk1(i,this.tryOpus);if(g)I.push({text:new J1(i,new z1({color:Y1})),position:"top-left",offsetY:0});else{let b=Pk(i,this.cachedVisibleModes)!==i,s=this.widget.dependencies.getCurrentWorker()||this.widget.dependencies.worker,q1=_$(s.thread)===0,o=z||!this.hasToggledAgentMode&&b&&q1?new J1("",void 0,[new J1(i,new z1({color:Y1})),new J1(" (click or ",new z1({color:Y.foreground,dim:!0})),new J1("Ctrl+S",new z1({color:W.keybind})),new J1(" to switch)",new z1({color:Y.foreground,dim:!0}))]):new J1(i,new z1({color:Y1}));I.push({text:o,position:"top-left",offsetY:0,onClick:q1?this.toggleAgentMode:void 0})}}if(this.connectedClientsStatus&&this.connectedClientsStatus.enabled){let g=this.connectedClientsStatus,i=g.mode||"disconnected",Y1=!!g.errorMessage,a=g.clientID||"unknown",b,s;if(Y1)b="●",s=O1.red;else if(i==="presence")b="○",s=O1.yellow;else if(i==="connected"&&g.connected)b="●",s=O1.green;else b="○",s=O1.yellow;let q1=this.connectedClientsStatusExpanded?`${a} ${b}`:b;I.push({text:new J1(q1,new z1({color:s})),position:"top-right",offsetX:-2,offsetY:0,onClick:this.toggleConnectedClientsStatus})}let S=K?this.widget.dependencies.replayMode.thread.env?.initial.trees?.[0]?.uri:G.mainThread?.env?.initial.trees?.[0]?.uri,y;if(S)y=n0.parse(S).fsPath;else y=process.cwd();let h=this.toHomeRelative(y),u=this.shorten(h),p=!K&&this.currentGitBranch?`${u} (${this.currentGitBranch})`:u;return I.push({text:new J1(p,new z1({color:Y.foreground,dim:!0})),position:"bottom-right"}),new Nj1({leftChild:new U4({child:U}),rightChild1:E,rightChild2:P,maxHeight:q,overlayTexts:I,borderColor:z||!this.isTextfieldAndAutocompleteFocused?O1.index(8):void 0,hasBanner:V,userHeight:this.bottomGridUserHeight,onInitializeHeight:(g)=>{this.setState(()=>{this.bottomGridUserHeight=Math.min(g,q)})},onDrag:(g)=>{if(this.bottomGridDragStartY===null)this.bottomGridDragStartY=Math.floor(g.localPosition.y),this.bottomGridDragStartHeight=this.bottomGridUserHeight;let i=Math.floor(g.localPosition.y)-this.bottomGridDragStartY,Y1=Math.max(4,this.bottomGridDragStartHeight-i),a=Math.min(Y1,q),b=Math.floor(a);if(this.bottomGridUserHeight!==b)this.setState(()=>{this.bottomGridUserHeight=b})},onDragRelease:()=>{this.bottomGridDragStartY=null,this.bottomGridDragStartHeight=null},enableResize:!V})}}async function Uk1(J){if((await J.configService.getLatest()).settings["terminal.animation"]===!1)E9.instance.tuiInstance.setOptions({queryOptions:{animationDisabled:!0}});let X=()=>null,Z=!1,q=new qz(Z,1000,J.inspectorPort),V=J.features?.find((A)=>A.name==="amp-connect")?.enabled??!1,K=new O_1({threadService:J.threadService,worker:J.worker,builder:(A,E,P,I,R,S)=>{if(X=R,J.threadDependencies&&V)yC1(J.threadDependencies,J.configService,R,I,J.connectedClientsService,J.startNewThread,J.switchToThread,J.clientId).catch((u)=>{f.error("Failed to start automatic presence:",u)});let y=R(),h={...J,worker:y,threadID:y.thread.id};return new TY6({...h,threadState:E,workerController:P,switchWorker:I,getCurrentWorker:R,recentThreadIDs:S})}}),W=new Oj1({configService:J.configService,child:K}),H=new Mj1({configService:J.configService,child:W}),z=new Zj1(H),U=new b6({data:MC.fromBaseTheme(fZ.default()),child:z});try{await GC1(U,{onRootElementMounted:(A)=>{if(f.info("TUI input ready for user interaction"),Z)q.start(A)}})}finally{if(Z)q.stop();if(J.threadDependencies&&V){let{stopGlobalSession:A}=await Promise.resolve().then(() => (xC1(),R76));A()}}let M=X()?.thread.id||J.threadID,L=await J.threadService.get(M);if(L&&L.messages.length>0){let A=`${J.ampURL.replace(/\/$/,"")}/threads/${M}`;o76(L,A,J.stdout)}}function Fk1(J,Q){return J==="smart"?Q?O1.rgb(0,255,136):O1.rgb(145,119,199):J==="rush"?O1.rgb(228,180,2):F5(J)?O1.rgb(0,184,255):J==="plan"?O1.rgb(153,102,255):$D8(J)}class CY6 extends G6{props;constructor(J){super();this.props=J}createState(){return new jY6}}class jY6 extends X6{viewportHeight=1;scrollListenerAttached=!1;initState(){if(!this.scrollListenerAttached)this.widget.props.controller.addListener(()=>{this.updateViewportHeight()}),this.scrollListenerAttached=!0}build(J){let{todos:Q,controller:Y,appTheme:X}=this.widget.props;return new q4({crossAxisAlignment:"stretch",children:[new U4({child:new O2({controller:Y,autofocus:!1,child:new w_1({todos:Q})})}),new XG({controller:Y,thumbColor:X.app.scrollbarThumb,trackColor:X.app.scrollbarTrack,getScrollInfo:()=>{let{maxScrollExtent:G,offset:Z}=Y,q=this.viewportHeight,V=G+q;return{totalContentHeight:Math.max(V,0),viewportHeight:Math.max(q,1),scrollOffset:Math.max(Z,0)}}})]})}updateViewportHeight(){let J=this.getViewportHeight();if(J!==this.viewportHeight)this.viewportHeight=J}getViewportHeight(){let J=this.context.findRenderObject();if(!J)return this.viewportHeight;let Q=(X,G=0)=>{if(X&&"size"in X&&"children"in X){let Z=X.children||[];for(let q of Z){if(q&&"size"in q){let K=q.size;if(typeof K?.height==="number"&&K.height>0)return K.height}let V=Q(q,G+1);if(V>0)return V}}return 0},Y=Q(J);if(Y>0)return Y;if("size"in J){let X=J.size;if(typeof X?.height==="number"&&X.height>0)return X.height}return this.viewportHeight}}class SY6 extends j6{props;constructor(J){super();this.props=J}build(J){return new k8({child:new M0({height:1}),cursor:l9.NS_RESIZE,onDrag:(Q)=>{if(this.props.userHeight===void 0){let X=J.findRenderObject()?.size.height??0;if(X>0){this.props.onInitializeHeight(X);return}}this.props.onDrag(Q)},onRelease:this.props.onRelease})}}function $D8(J){let Q=0;for(let G=0;G<J.length;G++){let Z=J.charCodeAt(G);Q=(Q<<5)-Q+Z,Q=Q&Q}let Y=[9,10,11,12,13,14,15,208,209,210,211,212,213,214,215],X=Math.abs(Q)%Y.length;return O1.index(Y[X])}XC1();try{if(process.platform==="win32")await Promise.resolve().then(() => N6(oC(),1))}catch{}if(process.env.AMP_PWD)try{process.chdir(process.env.AMP_PWD),delete process.env.AMP_PWD}catch(J){iZ.write(`Failed to change directory to ${process.env.AMP_PWD}: ${J}
|
|
4857
|
-
`)}var dy1=py1.join(Lz0||py1.join(process.env.HOME||process.cwd(),".local","state"),"amp","last-thread-id");function RO8(J){process.emitWarning=function(Q,Y,X,G){let Z=typeof Q==="string"?Q:Q.message||String(Q),q=Y||"Warning",V=!1;J.warn(Z,{name:q,code:X})}}function _q(J,Q){if(J.getOptionValueSourceWithGlobals("dangerouslyAllowAll")==="cli")hG("dangerouslyAllowAll",Q.dangerouslyAllowAll);if(J.getOptionValueSourceWithGlobals("mode")==="cli")hG("experimental.agentMode",Q.mode);if(J.getOptionValueSourceWithGlobals("tryOpus")==="cli"&&Q.tryOpus)hG("tryOpus",!0);if(J.getOptionValueSourceWithGlobals("useSonnet")==="cli")hG("model.sonnet",Q.useSonnet)}async function ly1(J){try{await IO8(py1.dirname(dy1),{recursive:!0}),await PO8(dy1,J,"utf-8")}catch(Q){f.debug("Failed to save last thread ID",Q)}}async function CO8(){try{return(await Y$6(dy1,"utf-8")).trim()}catch(J){return null}}var eZ6=[{name:"notifications",long:"notifications",type:"flag",description:(J)=>`${J?"Enable":"Disable"} sound notifications (enabled by default when not in execute mode)`},{name:"color",long:"color",type:"flag",description:(J)=>`${J?"Enable":"Disable"} color output (enabled by default if stdout and stderr are sent to a TTY)`,deprecated:!0},{name:"settingsFile",long:"settings-file",type:"option",default:process.env.AMP_SETTINGS_FILE??SZ,description:`Custom settings file path (overrides the default location ${SZ})`},{name:"logLevel",long:"log-level",type:"option",description:`Set log level (${Object.keys(f).join(", ")})`},{name:"logFile",long:"log-file",type:"option",description:`Set log file location (overrides the default location ${VR1})`},{name:"format",long:"format",type:"option",description:"output using the standard or new-ui. Options: `ui`, `new-ui`",choices:["ui","jsonl","new-ui"],hidden:!0,deprecated:!0},{name:"dangerouslyAllowAll",long:"dangerously-allow-all",type:"switch",default:!1,description:"Disable all command confirmation prompts (agent will execute all commands without asking)"},{name:"jetbrains",long:"jetbrains",type:"flag",default:c2(),description:(J)=>J?"Enable JetBrains integration. When enabled, Amp automatically includes your open JetBrains file and text selection with every message.":"Disable JetBrains integration"},{name:"ide",long:"ide",type:"flag",default:!0,description:(J)=>J?"Enable IDE connection (default). When enabled, Amp automatically includes your open IDE's file and text selection with every message.":"Disable IDE connection"},{name:"interactive",long:"interactive",type:"flag",description:(J)=>J?"Enable interactive mode. This will enable the interactive UI.":"Disable interactive mode. This will disable the interactive UI.",hidden:!0,deprecated:!0},{name:"mcpConfig",long:"mcp-config",type:"option",description:"JSON configuration or file path for MCP servers to merge with existing settings"},{name:"useSonnet",long:"use-sonnet",type:"flag",description:(J)=>J?"Use Claude Sonnet 4.5 instead of Gemini 3":"Use default model (Gemini 3)"},{name:"tryOpus",long:"try-opus",type:"switch",default:!1,description:"Try Claude Opus 4.5 in Amp's smart mode",hidden:!1},{name:"mode",long:"mode",short:"m",type:"option",default:nE.SMART.key,description:`Set the agent mode (${uG().map((J)=>J.mode).join(", ")}) — controls the model, system prompt, and tool selection`,choices:uG().map((J)=>J.mode)}],J$6=(J)=>("deprecated"in J)&&J.deprecated===!0,jO8=(J)=>("hidden"in J)&&J.hidden===!0,SO8=(J)=>("default"in J),_O8=(J)=>("default"in J)?J.default:void 0;function kO8(J,Q){let Y=Q.args[0],X=Q.commands.map((Z)=>Z.name());if(Y&&!Y.includes(" ")&&Y.length<30&&!/[./\\]/.test(Y)){let Z=X.filter((V)=>Y.includes(V)||V.includes(Y)),q="Run amp --help for a list of available commands.";if(Z.length>0)q=`Did you mean: ${Z.join(", ")}? Or run amp --help for all commands.`;throw new S8(jZ.unknownCommand(Y),1,q)}}var X$6=null;function DF5(){return X$6}function am(J){return{...J,getThreadEnvironment:z61,vfs:Pj0({os:J.fileSystem},J.configService.config),fileChangeTrackerStorage:new fv(J.fileSystem),generateThreadTitle:cc0,deleteThread:(Q)=>J.threadService.delete(Q)}}var iy1=n0.file(TO8.homedir()),G$6=process.env.XDG_CONFIG_HOME?n0.file(process.env.XDG_CONFIG_HOME):Z6.joinPath(iy1,".config");async function kq(J,Q){tU0("0.0.
|
|
4857
|
+
`)}var dy1=py1.join(Lz0||py1.join(process.env.HOME||process.cwd(),".local","state"),"amp","last-thread-id");function RO8(J){process.emitWarning=function(Q,Y,X,G){let Z=typeof Q==="string"?Q:Q.message||String(Q),q=Y||"Warning",V=!1;J.warn(Z,{name:q,code:X})}}function _q(J,Q){if(J.getOptionValueSourceWithGlobals("dangerouslyAllowAll")==="cli")hG("dangerouslyAllowAll",Q.dangerouslyAllowAll);if(J.getOptionValueSourceWithGlobals("mode")==="cli")hG("experimental.agentMode",Q.mode);if(J.getOptionValueSourceWithGlobals("tryOpus")==="cli"&&Q.tryOpus)hG("tryOpus",!0);if(J.getOptionValueSourceWithGlobals("useSonnet")==="cli")hG("model.sonnet",Q.useSonnet)}async function ly1(J){try{await IO8(py1.dirname(dy1),{recursive:!0}),await PO8(dy1,J,"utf-8")}catch(Q){f.debug("Failed to save last thread ID",Q)}}async function CO8(){try{return(await Y$6(dy1,"utf-8")).trim()}catch(J){return null}}var eZ6=[{name:"notifications",long:"notifications",type:"flag",description:(J)=>`${J?"Enable":"Disable"} sound notifications (enabled by default when not in execute mode)`},{name:"color",long:"color",type:"flag",description:(J)=>`${J?"Enable":"Disable"} color output (enabled by default if stdout and stderr are sent to a TTY)`,deprecated:!0},{name:"settingsFile",long:"settings-file",type:"option",default:process.env.AMP_SETTINGS_FILE??SZ,description:`Custom settings file path (overrides the default location ${SZ})`},{name:"logLevel",long:"log-level",type:"option",description:`Set log level (${Object.keys(f).join(", ")})`},{name:"logFile",long:"log-file",type:"option",description:`Set log file location (overrides the default location ${VR1})`},{name:"format",long:"format",type:"option",description:"output using the standard or new-ui. Options: `ui`, `new-ui`",choices:["ui","jsonl","new-ui"],hidden:!0,deprecated:!0},{name:"dangerouslyAllowAll",long:"dangerously-allow-all",type:"switch",default:!1,description:"Disable all command confirmation prompts (agent will execute all commands without asking)"},{name:"jetbrains",long:"jetbrains",type:"flag",default:c2(),description:(J)=>J?"Enable JetBrains integration. When enabled, Amp automatically includes your open JetBrains file and text selection with every message.":"Disable JetBrains integration"},{name:"ide",long:"ide",type:"flag",default:!0,description:(J)=>J?"Enable IDE connection (default). When enabled, Amp automatically includes your open IDE's file and text selection with every message.":"Disable IDE connection"},{name:"interactive",long:"interactive",type:"flag",description:(J)=>J?"Enable interactive mode. This will enable the interactive UI.":"Disable interactive mode. This will disable the interactive UI.",hidden:!0,deprecated:!0},{name:"mcpConfig",long:"mcp-config",type:"option",description:"JSON configuration or file path for MCP servers to merge with existing settings"},{name:"useSonnet",long:"use-sonnet",type:"flag",description:(J)=>J?"Use Claude Sonnet 4.5 instead of Gemini 3":"Use default model (Gemini 3)"},{name:"tryOpus",long:"try-opus",type:"switch",default:!1,description:"Try Claude Opus 4.5 in Amp's smart mode",hidden:!1},{name:"mode",long:"mode",short:"m",type:"option",default:nE.SMART.key,description:`Set the agent mode (${uG().map((J)=>J.mode).join(", ")}) — controls the model, system prompt, and tool selection`,choices:uG().map((J)=>J.mode)}],J$6=(J)=>("deprecated"in J)&&J.deprecated===!0,jO8=(J)=>("hidden"in J)&&J.hidden===!0,SO8=(J)=>("default"in J),_O8=(J)=>("default"in J)?J.default:void 0;function kO8(J,Q){let Y=Q.args[0],X=Q.commands.map((Z)=>Z.name());if(Y&&!Y.includes(" ")&&Y.length<30&&!/[./\\]/.test(Y)){let Z=X.filter((V)=>Y.includes(V)||V.includes(Y)),q="Run amp --help for a list of available commands.";if(Z.length>0)q=`Did you mean: ${Z.join(", ")}? Or run amp --help for all commands.`;throw new S8(jZ.unknownCommand(Y),1,q)}}var X$6=null;function DF5(){return X$6}function am(J){return{...J,getThreadEnvironment:z61,vfs:Pj0({os:J.fileSystem},J.configService.config),fileChangeTrackerStorage:new fv(J.fileSystem),generateThreadTitle:cc0,deleteThread:(Q)=>J.threadService.delete(Q)}}var iy1=n0.file(TO8.homedir()),G$6=process.env.XDG_CONFIG_HOME?n0.file(process.env.XDG_CONFIG_HOME):Z6.joinPath(iy1,".config");async function kq(J,Q){tU0("0.0.1764148488-g9863c7");let Y=A$1({storage:J.settings,secretStorage:J.secrets,workspaceRoots:X0.of([n0.file(process.cwd())]),defaultAmpURL:J.ampURL,homeDir:iy1,userConfigDir:G$6}),{initializeCLITelemetry:X}=await Promise.resolve().then(() => (D91(),N91));X(Y);let G=await Y.getLatest();f.debug("Global configuration initialized",{settingsKeys:Object.keys(G.settings)});let{toolService:Z,dispose:q}=Lt0({configService:Y}),V=new Map,K=()=>V.clear(),W=new LN1(Y,J.settings.getWorkspaceRootPath()),H=vC0({configService:Y,trustStore:W,createOAuthProvider:async(a)=>{let b=V.get(a);if(b)return f.debug("Reusing existing OAuth provider for server",{serverName:a}),b;f.debug("Creating OAuth provider for server",{serverName:a});let s=(async()=>{let q1=new yM(J.secrets),K1=await q1.getClientInfo(a),o=new dz1({storage:q1,serverName:a,clientId:K1?.clientId,clientSecret:K1?.clientSecret,scopes:K1?.scopes});return f.debug("OAuth provider created",{serverName:a,hasManualClientId:!!K1?.clientId,willUseDCR:!K1?.clientId}),o})();return V.set(a,s),s}}),z=O01({configService:Y,filesystem:U5,spawn:IA}),{initializeToolProviders:U}=await Promise.resolve().then(() => (tZ6(),sZ6)),{registrations:N,initErrors:M}=await U({toolService:Z,providers:[H,z],initialTimeout:J.executeMode?15000:5000});for(let[a,b]of M)f.warn(`${a} provider initialization slow or failed:`,b);if(Q.jetbrains)YI("JetBrains");else if(Q.ide&&w86())YI("VS Code");else if(Q.ide&&E86())YI("Neovim");if(J.executeMode)eU0(!0);let L,A=z2.status.pipe(q6((a)=>Boolean(a.connected&&a.authenticated)),x4()).subscribe((a)=>{if(a){if(!L)L=Z.registerTool(sr0)}else L?.dispose(),L=void 0}),E;if(!J.executeMode)E=new E61(process.cwd(),{},!0);else E=new class extends E61{async start(){}async query(){return[]}getStats(){return{state:"unstarted",stats:[]}}dispose(){}};if(!await J.secrets.get("apiKey",J.ampURL)){if(i5.write(`No API key found. Starting login flow...
|
|
4858
4858
|
`),!await yO8(J))await uA(),process.exit(1)}let P=await _j0({isDevelopment:!1}),I=new TE1(P,Y),R=new OE1(P,{lazy:!0}),S=new jN1(I,(a,b)=>{let s=N3.get(a);if(s)s.handle(b).catch((q1)=>{f.error("Failed to apply artifact delta",q1)})}),y=Q.notifications!==void 0?Q.notifications:!J.executeMode,h=Ot0({playNotificationSound:async(a)=>{if(y){At0(a);let b=QC1(),s=YC1();if((!b||s)&&G.settings["notifications.system.enabled"]!==!1){if(a==="idle")process.stdout.write("\x1B]777;notify;Amp;Agent is ready\x1B\\");else if(a==="requires-user-input")process.stdout.write("\x1B]777;notify;Amp;Waiting for approval\x1B\\")}}},windowFocused:()=>Promise.resolve(!1),threadService:I,configService:Y});f.info("Starting Amp background services");let u=ic0({threadService:I,threadHistoryService:R,configService:Y,isExtensionDevelopment:!1}),p;z2.status.subscribe((a)=>{p=a});let g=new ZZ1({workspaceRoots:[n0.file(process.cwd())],getCurrentFile:()=>{if(!p?.openFile)return;try{return n0.parse(p.openFile)}catch(a){f.warn("Failed to parse current file URI",{uri:p.openFile,error:a});return}},getOpenFiles:()=>{if(!p?.visibleFiles?.length)return[];let a=p.openFile;return p.visibleFiles.filter((b)=>b!==a).map((b)=>{try{return n0.parse(b)}catch(s){return f.warn("Failed to parse visible file URI",{uri:b,error:s}),null}}).filter((b)=>b!==null)}}),i=new ZC1,Y1={codebaseContextService:g,configService:Y,toolService:Z,mcpService:H,trustStore:W,threadService:I,threadHistoryService:R,threadSyncService:u,planFileManager:S,threadStorage:P,secretStorage:J.secrets,settingsStorage:J.settings,fuzzyServer:E,notificationService:h,fileSystem:Q.jetbrains||Q.ide?wj0:U5,terminal:i};return{...Y1,async asyncDispose(){for(let a of N.values())a.dispose();await Y1.mcpService.dispose(),K(),await Y1.threadService.asyncDispose(),Y1.configService.unsubscribe(),q(),Y1.fuzzyServer.dispose(),Y1.threadSyncService.dispose(),Y1.settingsStorage[Symbol.dispose](),A.unsubscribe(),L?.dispose()}}}async function yO8(J){if(!J.executeMode){if(!await yR1("Would you like to log in to Amp? [(y)es, (n)o]: "))return i5.write(`Login cancelled. Run the command again to retry.
|
|
4859
4859
|
`),!1}return await Z$6(J)}async function Z$6(J){let Q=EO8(32).toString("hex"),Y=await kR1(J.ampURL,Q),X=new AbortController;try{await YJ(Y,X.signal)}catch(Z){f.error("Error opening browser",{error:Z})}let G=await kR1(J.ampURL,Q,!1);i5.write(`If your browser does not open automatically, visit:
|
|
4860
4860
|
|
|
@@ -4864,15 +4864,15 @@ ${h4.blue.bold(G)}
|
|
|
4864
4864
|
Login successful! You can now use the Amp CLI.
|
|
4865
4865
|
`),!0}catch(Z){return f.error("Login failed",{error:Z}),iZ.write(`
|
|
4866
4866
|
Login failed: ${Z instanceof Error?Z.message:String(Z)}
|
|
4867
|
-
`),!1}}function xO8(){let J=new jA().name("amp").description("AI-powered coding assistant").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").configureOutput({writeErr:()=>{}});J.exitOverride((H)=>{if(H.code==="commander.help"||H.code==="commander.version"||H.exitCode===0)bR(),process.exit(0);let z=H.originalError??H;D46(z)}),J.option("-V, --version","Print the version number and exit",()=>{i5.write(`0.0.
|
|
4867
|
+
`),!1}}function xO8(){let J=new jA().name("amp").description("AI-powered coding assistant").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").configureOutput({writeErr:()=>{}});J.exitOverride((H)=>{if(H.code==="commander.help"||H.code==="commander.version"||H.exitCode===0)bR(),process.exit(0);let z=H.originalError??H;D46(z)}),J.option("-V, --version","Print the version number and exit",()=>{i5.write(`0.0.1764148488-g9863c7 (released 2025-11-26T09:19:56.054Z)
|
|
4868
4868
|
`),process.exit(0)}),J.addHelpText("after",L86()),J.configureHelp({formatHelp:A86}),J.command("logout").description("Log out by removing stored API key").action(async(H,z)=>{let U=z.optsWithGlobals(),N=await tQ(U);await bO8(N)}),J.command("login").description("Log in to Amp").addHelpText("after","If AMP_URL is set during login, it will be persisted to global settings for future CLI invocations, though AMP_URL will continue to take precedence.").action(async(H,z)=>{let U=z.optsWithGlobals(),N=await tQ(U);await hO8(N,await OR1(U,N.settings))});let Q=async(H,z,U)=>{A$1({storage:z.settings,secretStorage:z.secrets,workspaceRoots:X0.of([n0.file(process.cwd())]),defaultAmpURL:z.ampURL,homeDir:iy1,userConfigDir:G$6});let N={...z,executeMode:!1};await cy1(N,{...H,openThreadSwitcher:!0},U)},Y=J.command("threads").alias("t").alias("thread").summary("Manage threads").description("Thread management commands. When no subcommand is provided, defaults to listing threads.").action(async(H,z)=>{let U=z.optsWithGlobals(),N=await tQ(U);await Q$6(U,N,z)});Y.command("new").alias("n").summary("Create a new thread").description("Create a new thread and print its ID. The thread will be empty. You can set the visibility using the --visibility option.").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").action(async(H,z)=>{let U=z.optsWithGlobals(),N=await tQ(U);await lO8(U,N,z)}),Y.command("continue [threadId]").alias("c").summary("Continue an existing thread").description("Continue an existing thread by resuming the conversation. By default, shows an interactive picker with the most recently used thread at the top. Use --last to continue the last thread directly without the picker.").option("--last","Continue the last thread directly without showing the picker").option("--pick","Pick a thread interactively from a list (DEPRECATED: picker is now the default)").action(async(H,z,U)=>{let N=U.optsWithGlobals(),M=await tQ(N);if(z.pick)iZ.write(`${h4.yellow("Warning:")} The --pick flag is deprecated. The picker is now shown by default.
|
|
4869
4869
|
`);if(z.last||H||M.executeMode)await cO8(N,M,H,U);else await Q(N,M,U)}),Y.command("fork [threadId]").alias("f").summary("Fork an existing thread").description("Create a new thread by forking an existing one. This copies the conversation history up to the current point and creates a new thread where you can explore different directions. If no thread ID is provided, the most recently used thread will be forked.").action(async(H,z,U)=>{let N=U.optsWithGlobals(),M=await tQ(N);await dO8(N,M,H,U)}),Y.command("list").alias("l").alias("ls").summary("List all threads").description("List all your threads with their IDs, names, and last modified times.").action(async(H,z)=>{let U=z.optsWithGlobals(),N=await tQ(U);await Q$6(U,N,z)}),Y.command("share <threadId>").summary("Share a thread").description("Change thread visibility (private, public, unlisted, workspace, group) or share with Amp support for debugging. Use --visibility to change who can access the thread, or --support to share with the Amp team for troubleshooting.").alias("s").option("--visibility <visibility>","Set thread visibility (private, public, unlisted, workspace, group)").option("--support [message]","Share thread with Amp support for debugging").action(async(H,z,U)=>{let N=U.optsWithGlobals(),M=await tQ(N);await pO8(N,M,H,U,z.support)}),Y.command("rename <threadId> <newName>").alias("r").summary("Rename a thread").description('Change the title of a thread. Quote names with spaces: amp threads rename T-123 "New thread name"').action(async(H,z,U,N)=>{let M=N.optsWithGlobals(),L=await tQ(M);await gO8(M,L,H,z,N)}),Y.command("markdown <threadId>").alias("md").summary("Render thread as markdown").description("Render a thread as markdown. This outputs the entire conversation history in a readable markdown format.").action(async(H,z,U)=>{let N=U.optsWithGlobals(),M=await tQ(N);await mO8(N,M,H,U)}),Y.command("replay <threadId>").alias("p").summary("Replay a thread").description("Replay a thread by downloading it and playing through all interactions. User messages are simulated with variable typing speed.").option("--wpm <wpm>","Typing speed in words per minute (default: 120)","120").option("--no-typing","Disable typing simulation and display messages instantly").option("--message-delay <ms>","Delay between messages in milliseconds (default: 1000)","1000").option("--tool-progress-delay <ms>","Delay to show tool in-progress state in milliseconds (default: 800)","800").option("--exit-delay <seconds>","Delay in seconds before exiting after replay completes (default: 3)","3").option("--no-indicator","Hide the replay progress indicator").action(async(H,z,U)=>{let N=U.optsWithGlobals(),M=await tQ(N);await uO8(N,M,H,z,U)}),B56(J,async(H,z)=>{let U=await tQ(z);_q(H,z);let N=await kq(U,z);return{context:U,mcpService:N.mcpService,toolService:N.toolService,toolServices:N.toolService,configService:N.configService,cleanupTerminal:bR,asyncDispose:N.asyncDispose.bind(N)}}),X96(J,async(H)=>{let z=H.optsWithGlobals();return await tQ(z)}),n86(J,async(H)=>{let z=await tQ(H);return{settings:z.settings,secretStorage:z.secrets,getThreadDeps:async(U)=>{_q(U,H);let N=await kq(z,H);return{mcpService:N.mcpService,settings:z.settings,asyncDispose:N.asyncDispose.bind(N)}}}});function G(H,z,U){let M=typeof H.description==="string"?H.description:U===void 0?H.description(!0):H.description(U),L=new fB(z,M),A=_O8(H);if(A)L.default(A);if(L.hidden=jO8(H)||J$6(H),"choices"in H)L.choices([...H.choices]);return L}for(let H of eZ6)switch(H.type){case"flag":{J.addOption(G(H,`--${H.long}`)),J.addOption(G(H,`--no-${H.long}`,!1));break}case"switch":{J.addOption(G(H,`--${H.long}`,!0));break}default:{J.addOption(G(H,`${"short"in H?`-${H.short}, `:""}--${H.long} <value>`));break}}let Z=new fB("-x, --execute [message]","Use execute mode, optionally with user message. In execute mode, agent will execute provided prompt (either as argument, or via stdin). Only last assistant message is printed. Enabled automatically when redirecting stdout.").default(!1);J.addOption(Z);let q=new fB("-r, --remote","When used with -x/--execute, execute in an async agent on the Amp server.").default(!1).hideHelp();J.addOption(q);let V=new fB("--stream-json","When used with --execute, output in Claude Code-compatible stream JSON format instead of plain text.").default(!1);J.addOption(V);let K=new fB("--stream-json-input","Read JSON Lines user messages from stdin. Requires both --execute and --stream-json.").default(!1);J.addOption(K);let W=new fB("--stats","When used with --execute, output JSON with both result and token usage data (for /evals).").default(!1).hideHelp(!0);if(J.addOption(W),process.env.AMP_CONNECT==="1"){let H=new fB("--client-id <clientId>","Override the client ID for connect functionality (default: amp-<pid>@<hostname>)");J.addOption(H)}return J.action(async(H,z)=>{let U=H,N=await tQ(U);if(Object.keys(U).forEach((M)=>{let L=eZ6.find((A)=>A.name===M);if(L&&J$6(L)&&!SO8(L))iZ.write(h4.yellow(`Warning: '--${M}' flag is deprecated
|
|
4870
4870
|
`))}),z.args.length>0)kO8(N,z);await cy1(N,U,z)}),g86(J),J}async function Z51(J,Q){let{thread:Y,visibility:X}=Q,G=Y?.id??j$(),Z=am(J);if(Y)await J.threadStorage.set(G,Y);let q=await N3.getOrCreateForThread(Z,G),V=await J.threadStorage.get(G);if(Q.agentMode&&!V?.agentMode&&_$(q.thread)===0)await q.handle({type:"agent-mode",mode:Q.agentMode});if(X)await J.threadSyncService.updateThreadMeta(G,v61(X));let K=J.threadService.observe(G).subscribe(async(W)=>{if(ZJ(W,"assistant"))await ly1(G),K.unsubscribe()});return await q.resume(),q}async function cy1(J,Q,Y){let X=x61(Q);if(X instanceof Error)lZ(X.message);let G,Z=null;if(Q.streamJsonInput)G="";else if(typeof Q.execute==="string"){G=Q.execute;let i=(await xR1()).trimEnd();if(i)Z=i}else G=(await xR1()).trimEnd();if(Q.remote&&!J.executeMode)throw new S8("The -r/--remote flag currently only works with --execute mode",1,'Use: amp --remote --execute "your message"');if(Q.streamJson&&!J.executeMode)throw new S8("The --stream-json flag requires --execute mode",1,'Use: amp --execute "your message" --stream-json');if(Q.streamJsonInput&&!J.executeMode)throw new S8("The --stream-json-input flag requires --execute mode",1,"Use: amp --execute --stream-json --stream-json-input");if(Q.streamJsonInput&&!Q.streamJson)throw new S8("The --stream-json-input flag requires --stream-json",1,"Use: amp --execute --stream-json --stream-json-input");if((J.executeMode||Q.streamJson)&&F5(Q.mode))throw new S8(`Execute mode is not permitted with --mode '${Q.mode}'`,1);if(Q.stats&&!J.executeMode)throw new S8("The --stats flag requires --execute mode",1,'Use: amp --execute "your message" --stats');if(Q.streamJsonInput&&typeof Q.execute==="string"&&Q.execute.trim()!=="")throw new S8("Do not provide a message argument when using --stream-json-input",1,`Supply messages via stdin JSONL instead: echo '{"type":"user","message":{"role":"user","content":[{"type":"text","text":"your message"}]}}' | amp --execute --stream-json --stream-json-input`);if(J.executeMode&&G===""&&!Q.streamJsonInput)throw new S8("User message must be provided through stdin or as argument when using execute mode",1,`Either pass a message as an argument: amp --execute "your message"
|
|
4871
4871
|
Or pipe via stdin: echo "your message" | amp --execute`);_q(Y,Q);let q=await kq(J,Q);X$6=q;let V=am(q),K=async(i)=>{let Y1=await Y$6(i,"utf-8"),a=JSON.parse(Y1);if(!S$(a.id))throw new S8(jZ.invalidThreadId);return Z51(q,{visibility:X,agentMode:Q.mode,thread:a})},W=async(i)=>{if(!S$(i))throw new S8(jZ.invalidThreadId);try{let[a,b]=await Promise.all([E5.getThreadLinkInfo({thread:i},{config:q.configService}),E5.getUserInfo({},{config:q.configService})]);if(a.ok&&b.ok){let s=a.result.creatorUserID,q1=b.result.id;if(s&&s!==q1&&!process.env.AMP_RESUME_OTHER_USER_THREADS_INSECURE)throw new S8(`Cannot resume thread created by another user.
|
|
4872
4872
|
|
|
4873
4873
|
This thread belongs to a different user and cannot be continued for security reasons. Set AMP_RESUME_OTHER_USER_THREADS_INSECURE=1 to bypass this check.`)}}catch(a){if(a instanceof S8)throw a;f.warn("Failed to validate thread ownership in CLI, allowing to open",{error:a})}let Y1=await q.threadService.get(i)??void 0;return f.info(`[fetchAndStartThread] Loaded thread ${i}, agentMode: ${Y1?.agentMode??"undefined"}`),Z51(q,{visibility:X,agentMode:Y1?void 0:Q.mode,thread:Y1})},H=async()=>{try{if(Q.threadId)return W(Q.threadId);else return Z51(q,{visibility:X})}catch(i){if(i instanceof S8)throw i;throw await Ng(i,Q.threadId),Error("handleError should have called process.exit()")}},z=async()=>{return Z51(q,{visibility:X})};if(Q.format==="jsonl")iZ.write(`jsonl format is deprecated. Version "0.0.1752148945-gd8844f" or earlier is required to use jsonl format.
|
|
4874
|
-
`),await uA(),process.exit(1);if(J.executeMode&&Q.remote)await G96(G,Z,q.configService),await q.asyncDispose(),process.exit(0);let U=await H();if(J.executeMode)r86(q.mcpService,J.settings),await _46(U,U.threadID,G,Z,q,!!Q.streamJson,!!Q.streamJsonInput,!!Q.stats,J.ampURL),await q.asyncDispose(),process.exit(0);let N=!1,M=!1;if(Q.jetbrains||Q.ide){await ND0();let i=MI({jetbrainsOnly:Q.jetbrains});if(i.length===0){if(Q.jetbrains)M=!await q.configService.get("jetbrains.skipInstall")}else if(i.length===1){let Y1=i[0];if(Y1)z2.selectConfig(Y1)}else N=!0}let L=k61("0.0.
|
|
4875
|
-
`);let Q=!!J.execute||!process.stdout.isTTY&&!J.streamJson,Y=process.stdout.isTTY&&process.stderr.isTTY,X=await X86({...J,workspaceTrust:{current:!0,changes:a_},getHook:process.env.AMP_URL?(Z,q)=>{if(Z==="url")return Promise.resolve(process.env.AMP_URL);return q()}:void 0});if(J.mcpConfig){let Z=await a86(J.mcpConfig);X=o86(X,Z)}let G=await X.get("url","global");if(!G)G=zY;if(!yF(G))f.info("Targeting custom Amp server",{ampURL:G});return X=DF0(X),{executeMode:Q,isTTY:Y,ampURL:G,settings:X,secrets:Z96(await OR1(J,X))}}function vO8(J){let Q={};for(let Y=0;Y<J.length;Y++){let X=J[Y];if(X?.startsWith("--")){let Z=X.slice(2).replace(/-([a-z])/g,(V,K)=>K.toUpperCase()),q=J[Y+1];if(q&&!q.startsWith("--"))Q[Z]=q,Y++}}return Q}async function fO8(){let J=vO8(process.argv);if(V46({logLevel:J.logLevel||process.env.AMP_LOG_LEVEL,logFile:J.logFile||process.env.AMP_LOG_FILE}),RO8(f),f.info("Starting Amp CLI.",{version:"0.0.
|
|
4874
|
+
`),await uA(),process.exit(1);if(J.executeMode&&Q.remote)await G96(G,Z,q.configService),await q.asyncDispose(),process.exit(0);let U=await H();if(J.executeMode)r86(q.mcpService,J.settings),await _46(U,U.threadID,G,Z,q,!!Q.streamJson,!!Q.streamJsonInput,!!Q.stats,J.ampURL),await q.asyncDispose(),process.exit(0);let N=!1,M=!1;if(Q.jetbrains||Q.ide){await ND0();let i=MI({jetbrainsOnly:Q.jetbrains});if(i.length===0){if(Q.jetbrains)M=!await q.configService.get("jetbrains.skipInstall")}else if(i.length===1){let Y1=i[0];if(Y1)z2.selectConfig(Y1)}else N=!0}let L=k61("0.0.1764148488-g9863c7",q.settingsStorage),A=new U11(q.threadStorage),E=X0.of([n0.file(process.cwd())]),P=NZ1(void 0,E),I=new y61(q.mcpService,J.settings.getWorkspaceRootPath());if(G)U.handle({type:"user:message",message:{content:[{type:"text",text:G}]}});let R=(async()=>{try{let i=await E5.getUserFreeTierStatus({},{config:q.configService,signal:AbortSignal.timeout(5000)});if(i.ok)return f.info("User free tier status:",i),i.result}catch(i){f.error("Failed to fetch free tier status:",i)}})(),S=(async()=>{try{let i=await E5.getUserInfo({},{config:q.configService});if(i.ok)return i.result}catch(i){f.debug("Failed to fetch user workspace info:",i)}})(),[y,h]=await Promise.all([R,S]),u=h?.email,p=u&&(u.endsWith("@sourcegraph.com")||u.endsWith("@ampcode.com")||u==="auth-bypass-user@example.com");if(p)q.toolService.registerTool(Js0);let g=await V96();f.info("Loaded session state:",g),await Uk1({codebaseContextService:q.codebaseContextService,stdout:process.stdout,history:new N61,fuzzyServer:q.fuzzyServer,settingsStorage:q.settingsStorage,threadService:q.threadService,threadHistoryService:q.threadHistoryService,threadSyncService:q.threadSyncService,planFileManager:q.planFileManager,threadID:U.threadID,threadFuzzyIndexer:A,worker:U,workerDeps:V,configService:q.configService,internalAPIClient:E5,ampURL:J.ampURL,startNewThread:z,switchToThread:W,ideClient:z2,connectedClientsService:new Vi,commandRegistry:P,mcpService:q.mcpService,mcpTrustHandler:I,showJetBrainsInstaller:M,showIdePicker:N,openThreadSwitcher:Q.openThreadSwitcher,updateService:L,inspector:Q.inspector,inspectorPort:Q.inspectorPort,jetbrainsMode:Q.jetbrains,clientId:Q.clientId,sessionState:g,freeTierStatus:y,workspace:h?.team??null,features:h?.features??[],isDogfooding:p||!1,threadDependencies:q}),await q.asyncDispose(),process.exit(0)}async function tQ(J){if(J.interactive)iZ.write(`Warning: --interactive flag is deprecated. Interactive mode is now the default unless --execute is used or output is redirected.
|
|
4875
|
+
`);let Q=!!J.execute||!process.stdout.isTTY&&!J.streamJson,Y=process.stdout.isTTY&&process.stderr.isTTY,X=await X86({...J,workspaceTrust:{current:!0,changes:a_},getHook:process.env.AMP_URL?(Z,q)=>{if(Z==="url")return Promise.resolve(process.env.AMP_URL);return q()}:void 0});if(J.mcpConfig){let Z=await a86(J.mcpConfig);X=o86(X,Z)}let G=await X.get("url","global");if(!G)G=zY;if(!yF(G))f.info("Targeting custom Amp server",{ampURL:G});return X=DF0(X),{executeMode:Q,isTTY:Y,ampURL:G,settings:X,secrets:Z96(await OR1(J,X))}}function vO8(J){let Q={};for(let Y=0;Y<J.length;Y++){let X=J[Y];if(X?.startsWith("--")){let Z=X.slice(2).replace(/-([a-z])/g,(V,K)=>K.toUpperCase()),q=J[Y+1];if(q&&!q.startsWith("--"))Q[Z]=q,Y++}}return Q}async function fO8(){let J=vO8(process.argv);if(V46({logLevel:J.logLevel||process.env.AMP_LOG_LEVEL,logFile:J.logFile||process.env.AMP_LOG_FILE}),RO8(f),f.info("Starting Amp CLI.",{version:"0.0.1764148488-g9863c7",buildTimestamp:"2025-11-26T09:19:56.054Z"}),parseInt(process.version.slice(1).split(".")[0]??"")<20)throw new S8(jZ.nodeVersion(process.version),1,"Please upgrade your Node.js installation from https://nodejs.org");await xO8().parseAsync(process.argv)}NE1().startActiveSpan("main",async(J)=>{process.on("exit",()=>J.end()),await fO8().catch(Ng)});async function hO8(J,Q){if(process.env.AMP_URL)await J.settings.set("url",process.env.AMP_URL,"global"),i5.write(`Saving custom server URL to settings: ${process.env.AMP_URL}
|
|
4876
4876
|
`);else if(!yF(J.ampURL))i5.write(`Logging in to ${new URL(J.ampURL).hostname}
|
|
4877
4877
|
`);let Y=process.env.AMP_API_KEY;if(Y)i5.write(`API key found in environment variable, storing...
|
|
4878
4878
|
`),await Q.set("apiKey",Y,J.ampURL),i5.write(`API key successfully stored.
|
|
@@ -4885,7 +4885,7 @@ This thread belongs to a different user and cannot be continued for security rea
|
|
|
4885
4885
|
`);else i5.write(`Successfully logged out from ${new URL(J.ampURL).hostname}.
|
|
4886
4886
|
`);process.exit(0)}async function gO8(J,Q,Y,X,G){_q(G,J);let Z=await kq(Q,J);try{let q=$51(Y);if(!q)q51(Y);let V=q,K=X.trim();if(K.length===0)lZ("Thread name cannot be empty");if(K.length>256)lZ("Thread name cannot exceed 256 characters");if(!(await rC(V,Z)).messages.length)lZ("Cannot rename an empty thread.");let H=am(Z);await(await N3.getOrCreateForThread(H,V)).handle({type:"title",value:K}),f.info("GOT HERE"),await Z.threadSyncService.sync(),f.info("GOT THERE"),i5.write(h4.green(`✓ Thread ${V} renamed to "${K}"
|
|
4887
4887
|
`)),await Z.asyncDispose(),process.exit(0)}catch(q){await Z.asyncDispose();let V=`Failed to rename thread: ${q instanceof Error?q.message:String(q)}`;lZ(V)}}async function mO8(J,Q,Y,X){_q(X,J);let G=await kq(Q,J);try{let Z=$51(Y);if(!Z)q51(Y);let V=await rC(Z,G),K=$R(V);i5.write(K+`
|
|
4888
|
-
`),await G.asyncDispose(),process.exit(0)}catch(Z){await G.asyncDispose();let q=`Failed to render thread as markdown: ${Z instanceof Error?Z.message:String(Z)}`;lZ(q)}}async function uO8(J,Q,Y,X,G){_q(G,J);let Z=await kq(Q,J);try{let q=await ny1(Y),V=await rC(q,Z),K=X.typing!==!1,W=parseInt(X.wpm||"120",10),H=parseInt(X.messageDelay||"1000",10),z=parseInt(X.toolProgressDelay||"800",10),U=parseInt(X.exitDelay||"3",10)*1000,N=X.indicator!==!1,M=am(Z),L=V.id;await Z.threadStorage.set(L,V);let A=await N3.getOrCreateForThread(M,L);await A.resume();let E=F11.fromWorker(A),P=new U11(Z.threadStorage),I=X0.of([n0.file(process.cwd())]),R=NZ1(void 0,I),S=new y61(Z.mcpService,Q.settings.getWorkspaceRootPath()),y=k61("0.0.
|
|
4888
|
+
`),await G.asyncDispose(),process.exit(0)}catch(Z){await G.asyncDispose();let q=`Failed to render thread as markdown: ${Z instanceof Error?Z.message:String(Z)}`;lZ(q)}}async function uO8(J,Q,Y,X,G){_q(G,J);let Z=await kq(Q,J);try{let q=await ny1(Y),V=await rC(q,Z),K=X.typing!==!1,W=parseInt(X.wpm||"120",10),H=parseInt(X.messageDelay||"1000",10),z=parseInt(X.toolProgressDelay||"800",10),U=parseInt(X.exitDelay||"3",10)*1000,N=X.indicator!==!1,M=am(Z),L=V.id;await Z.threadStorage.set(L,V);let A=await N3.getOrCreateForThread(M,L);await A.resume();let E=F11.fromWorker(A),P=new U11(Z.threadStorage),I=X0.of([n0.file(process.cwd())]),R=NZ1(void 0,I),S=new y61(Z.mcpService,Q.settings.getWorkspaceRootPath()),y=k61("0.0.1764148488-g9863c7",Z.settingsStorage);await Uk1({codebaseContextService:Z.codebaseContextService,stdout:process.stdout,history:new N61,fuzzyServer:Z.fuzzyServer,settingsStorage:Z.settingsStorage,threadService:Z.threadService,threadHistoryService:Z.threadHistoryService,threadSyncService:Z.threadSyncService,planFileManager:Z.planFileManager,threadID:L,threadFuzzyIndexer:P,worker:E,workerDeps:M,configService:Z.configService,internalAPIClient:E5,ampURL:Q.ampURL,startNewThread:async()=>E,switchToThread:async()=>E,ideClient:z2,connectedClientsService:new Vi,commandRegistry:R,mcpService:Z.mcpService,mcpTrustHandler:S,showJetBrainsInstaller:!1,updateService:y,isDogfooding:!1,replayMode:{thread:V,typingEnabled:K,baseWpm:W,messageDelayMs:H,toolProgressDelayMs:z,exitDelayMs:U,showIndicator:N}}),await Z.asyncDispose(),process.exit(0)}catch(q){await Z.asyncDispose(),await Ng(q,Y)}}async function pO8(J,Q,Y,X,G){_q(X,J);let Z=await kq(Q,J);try{let q=$51(Y);if(!q)q51(Y);let V=q,K=await E5.getUserInfo({},{config:Z.configService}),W=K.ok?K.result:null,H=x61(J,W);if(!H&&!G)lZ("Must specify either --visibility or --support");if(H&&G)lZ("Cannot specify both --visibility and --support at the same time");if(H instanceof Error)lZ(H.message);if(H)await Z.threadSyncService.updateThreadMeta(V,v61(H)),i5.write(h4.green("✓ ")+`Thread ${V} visibility changed to ${H}.
|
|
4889
4889
|
`);if(G){await rC(V,Z);let z=typeof G==="string"?G:void 0;await pT0(Z.threadService,V,Z.configService,z),i5.write(h4.green("✓ ")+`Thread ${V} has been shared with Amp support. These thread reports will be aggregated and analysed.
|
|
4890
4890
|
`)}await Z.asyncDispose(),process.exit(0)}catch(q){await Z.asyncDispose(),lZ(`Failed to update thread: ${q instanceof Error?q.message:String(q)}`)}}async function dO8(J,Q,Y,X){_q(X,J);let G=await kq(Q,J),Z=am(G);try{let q=await ny1(Y),K=(await rC(q,G)).messages.length-1,W=await N3.getOrCreateForThread(Z,q),H=await qR(W,G.threadSyncService,K);await Promise.all([G.threadSyncService.uploadThread(q),G.threadSyncService.uploadThread(H)]),await ly1(H),i5.write(`${H}
|
|
4891
4891
|
`),await G.asyncDispose(),process.exit(0)}catch(q){iZ.write(`Error forking thread: ${q instanceof Error?q.message:String(q)}
|