brsh 3.9.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/Readme.md +22 -4
  3. package/bin/Readme.md +33 -3
  4. package/bin/exportFileSystem.js +127 -110
  5. package/bin/wbt.js +118 -0
  6. package/dist/shell.es.js +4074 -3717
  7. package/dist/shell.es.js.map +1 -1
  8. package/dist/shell.min.js +26 -25
  9. package/dist/shell.min.js.map +1 -1
  10. package/dist/terminal.cjs.js +3 -3
  11. package/dist/terminal.cjs.js.map +1 -1
  12. package/dist/terminal.es.js +55 -33
  13. package/dist/terminal.es.js.map +1 -1
  14. package/dist/terminal.min.js +3 -3
  15. package/dist/terminal.min.js.map +1 -1
  16. package/dist/wbt.es.js +3082 -2710
  17. package/dist/wbt.es.js.map +1 -1
  18. package/dist/wbt.min.js +16 -12
  19. package/dist/wbt.min.js.map +1 -1
  20. package/index.js +102 -80
  21. package/lib/BaseFileSystem.js +57 -2
  22. package/lib/BinaryContainer.js +1 -1
  23. package/lib/Command.js +1 -1
  24. package/lib/Context.js +4 -3
  25. package/lib/FileSystem.js +4 -2
  26. package/lib/InteractiveCommand.js +9 -8
  27. package/lib/JsCommand.js +113 -0
  28. package/lib/NodeFileSystem.js +164 -30
  29. package/lib/Readme.md +1 -0
  30. package/lib/ScriptCommand.js +148 -8
  31. package/lib/Terminal.js +60 -6
  32. package/lib/TtyStream.js +36 -2
  33. package/lib/WasmCommand.js +313 -66
  34. package/lib/buildFilesystemStructure.js +38 -24
  35. package/lib/isUtf8Text.js +47 -0
  36. package/lib/local/which.js +8 -3
  37. package/lib/wbt/index.js +473 -175
  38. package/lib/wbt/registry.js +21 -1
  39. package/package.json +3 -2
  40. package/test/devices-signals.test.js +112 -0
  41. package/test/doom.test.js +7 -4
  42. package/test/exportFileSystem.test.js +37 -15
  43. package/test/js-command.test.js +125 -0
  44. package/test/node-filesystem.test.js +7 -0
  45. package/test/scripts.test.js +30 -0
  46. package/test/terminal.test.js +148 -0
  47. package/test/wasm-cli.test.js +76 -0
  48. package/test/wbt.test.js +418 -10
  49. package/test/wbtCli.test.js +160 -0
@@ -68,11 +68,11 @@ finally:
68
68
  sys.exit(os.waitstatus_to_exitcode(status) if hasattr(os, "waitstatus_to_exitcode") else 0)
69
69
  except Exception:
70
70
  sys.exit(0)
71
- `;function M(e){if(typeof process<`u`&&process.env&&process.env.SHELL)return process.env.SHELL;try{let t=e?e(`fs`):null;if(t){for(let e of[`/bin/zsh`,`/usr/bin/zsh`,`/bin/bash`,`/usr/bin/bash`,`/bin/sh`])if(t.existsSync(e))return e}}catch{}return`/bin/sh`}function N(e,t=[],n={}){let r=typeof require==`function`?require:typeof globalThis<`u`&&globalThis.process&&globalThis.process.getBuiltinModule?e=>globalThis.process.getBuiltinModule(e):null;if(!r)throw Error(`spawnPty is only available in a Node.js environment`);let i=e||M(r),{spawn:a}=r(`child_process`),o=n.cols||80,s=n.rows||24,c=n.cwd||(typeof process<`u`?process.cwd():``),l=Object.assign({},typeof process<`u`?process.env:{},{TERM:`xterm-256color`,COLORTERM:`truecolor`,COLUMNS:String(o),LINES:String(s)},n.env||{}),u=a(`python3`,[`-u`,`-c`,j,i,JSON.stringify(t),String(o),String(s),c],{env:l,stdio:[`pipe`,`pipe`,`pipe`]}),d=new Map,f=(e,...t)=>{let n=d.get(e);if(n)for(let e of[...n])e(...t)};return u.stdout.on(`data`,e=>f(`data`,e)),u.on(`exit`,(e,t)=>f(`exit`,e,t)),u.on(`close`,e=>f(`close`,e)),u.on(`error`,e=>f(`error`,e)),{pid:u.pid,process:u,write(e){u.stdin&&!u.stdin.destroyed&&u.stdin.write(e)},resize(e,t){u.stdin&&!u.stdin.destroyed&&u.stdin.write(`\x1b]9999;${Math.max(1,e)};${Math.max(1,t)}\x07`)},on(e,t){return d.has(e)||d.set(e,[]),d.get(e).push(t),this},removeListener(e,t){let n=d.get(e);if(!n)return this;let r=n.indexOf(t);return r!==-1&&n.splice(r,1),this},kill(e=`SIGTERM`){try{u.kill(e)}catch{}}}}var P=c.default?.default??c.default,F=class{constructor(){this._listeners=new Map,this.readable=!0,this.writable=!0,this.isTTY=!0}on(e,t){return this._listeners.has(e)||this._listeners.set(e,[]),this._listeners.get(e).push(t),this}addListener(e,t){return this.on(e,t)}once(e,t){let n=(...r)=>{this.removeListener(e,n),t(...r)};return this.on(e,n)}removeListener(e,t){let n=this._listeners.get(e);if(!n)return this;let r=n.indexOf(t);return r!==-1&&n.splice(r,1),this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){return e?this._listeners.delete(e):this._listeners.clear(),this}listeners(e){return[...this._listeners.get(e)||[]]}emit(e,...t){let n=this._listeners.get(e);if(!n||n.length===0)return!1;for(let e of[...n])e(...t);return!0}setRawMode(e){return this.isRaw=!!e,this}resume(){return this}pause(){return this}setEncoding(e){return this._encoding=e,this}pipe(e){return this.on(`data`,t=>e.write(t)),e}unpipe(){return this}destroy(){this.removeAllListeners()}},I=class{constructor(e={}){let{el:t,font:n=`Roboto Mono`,cursor:r=`none`,outputAnimation:i=`none`,animateSpeed:a=1,onExit:o=null,mobileInput:s=`click`,lineWrap:c=!1,command:l=null,cols:u=80,rows:d=24,maxScrollback:p=1e3,stream:m=null}=e;if(!t)throw Error("you must set `el` option");if(![`none`,`block`,`blink`].includes(r))throw Error(`cursor value must be one of: 'none', 'block', 'blink'`);if(![`none`,`type`].includes(i))throw Error(`outputAnimation value must be one of: 'none', 'type'`);if(!Number.isInteger(a)||a<1||a>20)throw Error(`animateSpeed value must be between 1 and 20`);if(this._exitFn=o,this._cursor=r,this._outputAnimation=i,this._animateSpeed=a,this._lineWrap=c,this._el=t,this._dataListeners=[],this._resizeListeners=[],this._titleListeners=[],this._mouseButtonDown=null,this._mobileInputElement=null,this._onMobileInputClick=null,this._typeQueue=``,this._typeTimer=null,this._isHandlingInput=!1,this._suppressAnimationUntil=0,this.screen=new f(u,d,{maxScrollback:p}),this.parser=new S(this.screen,{urlWhitelist:b,onResponse:e=>this._emitInput(e),onTitle:e=>{this.title=e;for(let t of this._titleListeners)t(e)}}),this.cli=e.cli||e.shell||null,!this.cli&&!m&&e.Shell!==!1){let t=e.Shell===null?null:e.Shell||typeof globalThis<`u`&&(globalThis.Shell||globalThis.shell)||(typeof P==`function`?P:null);if(!t)throw Error(`Shell is required by Terminal. Please import Shell from "brsh" or include shell.min.js before terminal.min.js.`);this.cli=new t(Object.assign({},e,{command:void 0}))}this._setupDom(this._el,n),this.renderer=new A(this._cmdList,this.screen,{cursor:this._cursor,urlWhitelist:b}),this._listenForEvents(),this.cli&&(this.attach(this.cli),typeof this.cli.on==`function`&&this.cli.on(`exit`,e=>{delete this.cli,typeof this._exitFn==`function`&&this._exitFn(e)}),l&&this.onCommand(l)),m&&(this.attach(m),l&&this.onCommand(l)),s===`click`&&this._mobileInput(),this.renderer.flushRender()}get cols(){return this.screen.cols}get rows(){return this.screen.rows}write(e){if(e==null||e===``)return;let t=typeof e==`string`?e:e instanceof Uint8Array||typeof Buffer<`u`&&Buffer.isBuffer(e)?new TextDecoder().decode(e):String(e);if(this._outputAnimation===`type`){if(this._isUserInputActive()||this._isFullScreenWrite(t)){this._flushTypeQueue(),this.parser.write(t),this.renderer.flushRender(),this._autoScroll();return}if((this._isLineRewrite(t)||!/[^\r\n]/.test(t))&&(!this._typeQueue||!this._typeQueue.includes(`
71
+ `;function M(e){if(typeof process<`u`&&process.env&&process.env.SHELL)return process.env.SHELL;try{let t=e?e(`fs`):null;if(t){for(let e of[`/bin/zsh`,`/usr/bin/zsh`,`/bin/bash`,`/usr/bin/bash`,`/bin/sh`])if(t.existsSync(e))return e}}catch{}return`/bin/sh`}function N(e,t=[],n={}){let r=typeof require==`function`?require:typeof globalThis<`u`&&globalThis.process&&globalThis.process.getBuiltinModule?e=>globalThis.process.getBuiltinModule(e):null;if(!r)throw Error(`spawnPty is only available in a Node.js environment`);let i=e||M(r),{spawn:a}=r(`child_process`),o=n.cols||80,s=n.rows||24,c=n.cwd||(typeof process<`u`?process.cwd():``),l=Object.assign({},typeof process<`u`?process.env:{},{TERM:`xterm-256color`,COLORTERM:`truecolor`,COLUMNS:String(o),LINES:String(s)},n.env||{}),u=a(`python3`,[`-u`,`-c`,j,i,JSON.stringify(t),String(o),String(s),c],{env:l,stdio:[`pipe`,`pipe`,`pipe`]}),d=new Map,f=(e,...t)=>{let n=d.get(e);if(n)for(let e of[...n])e(...t)};return u.stdout.on(`data`,e=>f(`data`,e)),u.on(`exit`,(e,t)=>f(`exit`,e,t)),u.on(`close`,e=>f(`close`,e)),u.on(`error`,e=>f(`error`,e)),{pid:u.pid,process:u,write(e){u.stdin&&!u.stdin.destroyed&&u.stdin.write(e)},resize(e,t){u.stdin&&!u.stdin.destroyed&&u.stdin.write(`\x1b]9999;${Math.max(1,e)};${Math.max(1,t)}\x07`)},on(e,t){return d.has(e)||d.set(e,[]),d.get(e).push(t),this},removeListener(e,t){let n=d.get(e);if(!n)return this;let r=n.indexOf(t);return r!==-1&&n.splice(r,1),this},kill(e=`SIGTERM`){try{u.kill(e)}catch{}}}}var P=c.default?.default??c.default,F=class{constructor(){this._listeners=new Map,this.readable=!0,this.writable=!0,this.isTTY=!0}on(e,t){return this._listeners.has(e)||this._listeners.set(e,[]),this._listeners.get(e).push(t),this}addListener(e,t){return this.on(e,t)}once(e,t){let n=(...r)=>{this.removeListener(e,n),t(...r)};return this.on(e,n)}removeListener(e,t){let n=this._listeners.get(e);if(!n)return this;let r=n.indexOf(t);return r!==-1&&n.splice(r,1),this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){return e?this._listeners.delete(e):this._listeners.clear(),this}listeners(e){return[...this._listeners.get(e)||[]]}emit(e,...t){let n=this._listeners.get(e);if(!n||n.length===0)return!1;for(let e of[...n])e(...t);return!0}setRawMode(e){return this.isRaw=!!e,this}resume(){return this}pause(){return this}setEncoding(e){return this._encoding=e,this}pipe(e){return this.on(`data`,t=>e.write(t)),e}unpipe(){return this}destroy(){this.removeAllListeners()}},I=class{constructor(e={}){let{el:t,font:n=`Roboto Mono`,cursor:r=`none`,outputAnimation:i=`none`,animateSpeed:a=1,onExit:o=null,mobileInput:s=`click`,lineWrap:c=!1,command:l=null,cols:u=80,rows:d=24,maxScrollback:p=1e3,stream:m=null}=e;if(!t)throw Error("you must set `el` option");if(![`none`,`block`,`blink`].includes(r))throw Error(`cursor value must be one of: 'none', 'block', 'blink'`);if(![`none`,`type`].includes(i))throw Error(`outputAnimation value must be one of: 'none', 'type'`);if(!Number.isInteger(a)||a<1||a>20)throw Error(`animateSpeed value must be between 1 and 20`);if(this._exitFn=o,this._cursor=r,this._outputAnimation=i,this._animateSpeed=a,this._lineWrap=c,this._el=t,this._dataListeners=[],this._resizeListeners=[],this._titleListeners=[],this._mouseButtonDown=null,this._mobileInputElement=null,this._onMobileInputClick=null,this._typeQueue=``,this._typeTimer=null,this._isHandlingInput=!1,this._suppressAnimationUntil=0,this.screen=new f(u,d,{maxScrollback:p}),this.parser=new S(this.screen,{urlWhitelist:b,onResponse:e=>this._emitInput(e),onTitle:e=>{this.title=e;for(let t of this._titleListeners)t(e)}}),this.cli=e.cli||e.shell||null,!this.cli&&!m&&e.Shell!==!1){let t=e.Shell===null?null:e.Shell||typeof globalThis<`u`&&(globalThis.Shell||globalThis.shell)||(typeof P==`function`?P:null);if(!t)throw Error(`Shell is required by Terminal. Please import Shell from "brsh" or include shell.min.js before terminal.min.js.`);this.cli=new t(Object.assign({},e,{command:void 0}))}this._setupDom(this._el,n),this.renderer=new A(this._cmdList,this.screen,{cursor:this._cursor,urlWhitelist:b}),this._measureAndSetSize(),this._listenForEvents(),this.cli&&(this.attach(this.cli),typeof this.cli.on==`function`&&this.cli.on(`exit`,e=>{delete this.cli,typeof this._exitFn==`function`&&this._exitFn(e)}),l&&this.onCommand(l)),m&&(this.attach(m),l&&this.onCommand(l)),s===`click`&&this._mobileInput(),this.renderer.flushRender()}get cols(){return this.screen.cols}get rows(){return this.screen.rows}write(e){if(e==null||e===``)return;let t=typeof e==`string`?e:e instanceof Uint8Array||typeof Buffer<`u`&&Buffer.isBuffer(e)?new TextDecoder().decode(e):String(e);if(this._outputAnimation===`type`){if(this._isUserInputActive()||this._isFullScreenWrite(t)){this._flushTypeQueue(),this.parser.write(t),this.renderer.flushRender(),this._autoScroll();return}if((this._isLineRewrite(t)||!/[^\r\n]/.test(t))&&(!this._typeQueue||!this._typeQueue.includes(`
72
72
  `))){this._flushTypeQueue(),this.parser.write(t),this.renderer.flushRender(),this._autoScroll();return}this._enqueueTypeAnimation(t);return}this.parser.write(t),this.renderer.flushRender(),this._autoScroll()}writeln(e=``){this.write(String(e)+`\r
73
73
  `)}clear(){this.write(`\x1B[2J\x1B[3J\x1B[H`)}reset(){this._flushTypeQueue(),this.parser.reset(),this.renderer.flushRender(),this._mobileInputBuffer=``,this._mobileInputElement&&(this._mobileInputElement.value=``)}onData(e){return typeof e==`function`?(this._dataListeners.push(e),()=>{let t=this._dataListeners.indexOf(e);t!==-1&&this._dataListeners.splice(t,1)}):()=>{}}onResize(e){return typeof e==`function`?(this._resizeListeners.push(e),()=>{let t=this._resizeListeners.indexOf(e);t!==-1&&this._resizeListeners.splice(t,1)}):()=>{}}onTitleChange(e){return typeof e==`function`?(this._titleListeners.push(e),()=>{let t=this._titleListeners.indexOf(e);t!==-1&&this._titleListeners.splice(t,1)}):()=>{}}resize(e,t){let n=Math.max(1,Math.floor(e)),r=Math.max(1,Math.floor(t));if(!(n===this.screen.cols&&r===this.screen.rows&&this._lastCols===n&&this._lastRows===r)){this._lastCols=n,this._lastRows=r,this.screen.resize(n,r),this.cli&&typeof this.cli.setTerminalSize==`function`&&this.cli.setTerminalSize(n,r);for(let e of this._resizeListeners)e({cols:n,rows:r});this.renderer.flushRender()}}attach(e){if(!e)return()=>{};this._attachedStream=e;let t=e=>{this.write(e)};typeof e.on==`function`?e.on(`data`,t):typeof e.addEventListener==`function`&&e.addEventListener(`message`,e=>this.write(e.data??e));let n=this.onData(t=>{typeof e.write==`function`?e.write(t):typeof e.send==`function`&&e.send(t)}),r=this.onResize(({cols:t,rows:n})=>{typeof e.resize==`function`&&e.resize(t,n)});return typeof e.resize==`function`&&e.resize(this.cols,this.rows),()=>{n(),r(),typeof e.removeListener==`function`&&e.removeListener(`data`,t),this._attachedStream===e&&(this._attachedStream=null)}}spawn(e,t=[],n={}){let r=N(e,t,Object.assign({cols:this.cols,rows:this.rows},n)),i=this.attach(r);return r.on(`exit`,e=>{typeof this._exitFn==`function`&&this._exitFn(e)}),{pty:r,detach:i}}createTty(e={}){let t=new F,n=new F;e.interceptShell,n.columns=this.cols,n.rows=this.rows,n.getWindowSize=()=>[n.columns,n.rows],n.write=(e,t,n)=>(this.write(e),typeof t==`function`?t():typeof n==`function`&&n(),!0);let r=this.onData(e=>{let n=t._encoding?e:typeof Buffer<`u`?Buffer.from(e,`utf8`):e;t.emit(`data`,n)}),i=this.onResize(({cols:e,rows:t})=>{n.columns=e,n.rows=t,n.emit(`resize`)});return{stdin:t,stdout:n,dispose:()=>{r(),i(),t.destroy(),n.destroy()}}}sendKey(e,t={}){let n=this._encodeKey(e,t);n&&this._emitInput(n)}sendMouse(e,{button:t=0,col:n=1,row:r=1,shift:i=!1,alt:a=!1,ctrl:o=!1,deltaY:s=0}={}){let c=this.parser.mouseTrackingMode,l=Math.max(1,Math.min(this.cols,n)),u=Math.max(1,Math.min(this.rows,r));if(c===0||i){if(e===`wheel`)if(this.screen.isAltScreen&&this.parser.alternateScrollMode){let e=s<0?`ArrowUp`:`ArrowDown`;this.sendKey(e)}else this.screen.isAltScreen||(this.screen.scrollViewport(s<0?3:-3),this.renderer.flushRender());return!1}let d=t;if(e===`wheel`)d=s<0?64:65;else if(e===`mousemove`){if(c===1e3||c===1002&&this._mouseButtonDown===null)return!1;d=(this._mouseButtonDown??0)+32}else e===`mousedown`?this._mouseButtonDown=t:e===`mouseup`&&(this._mouseButtonDown=null,this.parser.mouseProtocol!==`sgr`&&(d=3));if(i&&(d+=4),a&&(d+=8),o&&(d+=16),this.parser.mouseProtocol===`sgr`){let t=e===`mouseup`?`m`:`M`;return this._emitInput(`\x1b[<${d};${l};${u}${t}`),!0}let f=this.parser.mouseProtocol===`utf8`?2015:223,p=Math.min(f,l),m=Math.min(f,u);return this._emitInput(`\x1B[M`+String.fromCharCode(32+d)+String.fromCharCode(32+p)+String.fromCharCode(32+m)),!0}onCommand(e){this.cli&&typeof this.cli.sendCommand==`function`?this.cli.sendCommand(e):this._emitInput(String(e)+`\r`)}getScreenText(e){return this.renderer.flushRender(),this.screen.getScreenText(e)}getLineText(e,t=!0){return this.renderer.flushRender(),this.screen.getLineText(e,t)}_emitInput(e){if(!e)return;this.screen.viewportOffset>0&&(this.screen.viewportOffset=0,this.screen._markAllDirty(),this.renderer.flushRender()),(this._typeQueue||this._typeTimer!==null)&&(this._flushTypeQueue(),this.renderer.flushRender(),this._autoScroll());let t=e===`\r`||e===`
74
74
  `||e===`\r
75
- `;t&&this._mobileInputElement&&(this._mobileInputElement.value=``,this._mobileInputBuffer=``),this._suppressAnimationUntil=t?0:Date.now()+80,this._isHandlingInput=!t;try{for(let t of this._dataListeners)t(e)}finally{this._isHandlingInput=!1}}_flushTypeQueue(){if(this._typeTimer!==null&&(clearInterval(this._typeTimer),this._typeTimer=null),this._typeQueue){let e=this._typeQueue;this._typeQueue=``,this.parser.write(e)}}_isUserInputActive(){return!!(this._isHandlingInput||this._suppressAnimationUntil&&Date.now()<this._suppressAnimationUntil)}_isFullScreenWrite(e){if(this.screen.isAltScreen)return!0;if(this.cli&&this.cli.runningCommand){let e=this.cli.runningCommand;if(e.interactive||e._inAltScreen||e.stdinStream&&e.stdinStream.isRaw)return!0}return!!(this._attachedStream&&this._attachedStream.isRaw||/\x1b\[\?(?:1049|1047|47)[hl]/.test(e)||/\x1b\[(?:\d*J|(?:\d+;\d+)?[Hf]|\d*[ABLM]|\d*;\d*r)/.test(e))}_isLineRewrite(e){return!!(/\r(?!\n)/.test(e)||/\x1b\[\d*[KCDG@P]/.test(e)||/[\x08\x7f]/.test(e))}_encodeKey(e,t={}){let{alt:n=!1,ctrl:r=!1,shift:i=!1,meta:a=!1}=t;if(!e||[`Control`,`Alt`,`Shift`,`Meta`,`CapsLock`].includes(e)||a)return null;let o=this.parser.applicationCursorKeys;if(e===`ArrowUp`)return n?`\x1B[1;3A`:r?`\x1B[1;5A`:o?`\x1BOA`:`\x1B[A`;if(e===`ArrowDown`)return n?`\x1B[1;3B`:r?`\x1B[1;5B`:o?`\x1BOB`:`\x1B[B`;if(e===`ArrowRight`)return n?`\x1B[1;3C`:r?`\x1B[1;5C`:o?`\x1BOC`:`\x1B[C`;if(e===`ArrowLeft`)return n?`\x1B[1;3D`:r?`\x1B[1;5D`:o?`\x1BOD`:`\x1B[D`;if(e===`Home`)return o?`\x1BOH`:`\x1B[H`;if(e===`End`)return o?`\x1BOF`:`\x1B[F`;if(e===`Delete`)return`\x1B[3~`;if(e===`Insert`)return`\x1B[2~`;if(e===`PageUp`)return`\x1B[5~`;if(e===`PageDown`)return`\x1B[6~`;if(e===`Enter`)return`\r`;if(e===`Backspace`)return n?`\x1B`:``;if(e===`Tab`)return i?`\x1B[Z`:` `;if(e===`Escape`)return`\x1B`;let s=e.match(/^F(\d{1,2})$/);if(s)return{1:`\x1BOP`,2:`\x1BOQ`,3:`\x1BOR`,4:`\x1BOS`,5:`\x1B[15~`,6:`\x1B[17~`,7:`\x1B[18~`,8:`\x1B[19~`,9:`\x1B[20~`,10:`\x1B[21~`,11:`\x1B[23~`,12:`\x1B[24~`}[Number(s[1])]||null;if(r&&e.length===1){let t=e.toUpperCase().charCodeAt(0);if(t>=64&&t<=95){let e=String.fromCharCode(t-64);return n?`\x1B`+e:e}}return e.length===1?n?`\x1B`+e:e:null}_enqueueTypeAnimation(e){this._typeQueue+=e,this._typeTimer===null&&(this._typeTimer=setInterval(()=>{if(!this._typeQueue){clearInterval(this._typeTimer),this._typeTimer=null;return}if(this._isFullScreenWrite(this._typeQueue)){this._flushTypeQueue(),this.renderer.flushRender(),this._autoScroll();return}let e=0,t=0,n=this._typeQueue.indexOf(`
75
+ `;t&&this._mobileInputElement&&(this._mobileInputElement.value=``,this._mobileInputBuffer=``),this._suppressAnimationUntil=t?0:Date.now()+80,this._isHandlingInput=!t;try{for(let t of this._dataListeners)t(e)}finally{this._isHandlingInput=!1}}_flushTypeQueue(){if(this._typeTimer!==null&&(clearInterval(this._typeTimer),this._typeTimer=null),this._typeQueue){let e=this._typeQueue;this._typeQueue=``,this.parser.write(e)}}_isUserInputActive(){return!!(this._isHandlingInput||this._suppressAnimationUntil&&Date.now()<this._suppressAnimationUntil)}_isFullScreenWrite(e){if(this.screen.isAltScreen)return!0;if(this.cli&&this.cli.runningCommand){let e=this.cli.runningCommand;if(e.interactive||e._inAltScreen||e.isRaw||e.stdinStream&&e.stdinStream.isRaw)return!0}return!!(this._attachedStream&&this._attachedStream.isRaw||/\x1b\[\?(?:1049|1047|47)[hl]/.test(e)||/\x1b\[(?:\d*J|(?:\d+;\d+)?[Hf]|\d*[ABLM]|\d*;\d*r)/.test(e))}_isLineRewrite(e){return!!(/\r(?!\n)/.test(e)||/\x1b\[\d*[KCDG@P]/.test(e)||/[\x08\x7f]/.test(e))}_encodeKey(e,t={}){let{alt:n=!1,ctrl:r=!1,shift:i=!1,meta:a=!1}=t;if(!e||[`Control`,`Alt`,`Shift`,`Meta`,`CapsLock`,`NumLock`,`ScrollLock`,`Dead`,`Unidentified`].includes(e)||a)return null;let o={Up:`ArrowUp`,Down:`ArrowDown`,Right:`ArrowRight`,Left:`ArrowLeft`,Esc:`Escape`,Return:`Enter`,Del:`Delete`,Space:` `,Spacebar:` `}[e]||e,s=this.parser.applicationCursorKeys;if(o===`ArrowUp`)return n?`\x1B[1;3A`:r?`\x1B[1;5A`:s?`\x1BOA`:`\x1B[A`;if(o===`ArrowDown`)return n?`\x1B[1;3B`:r?`\x1B[1;5B`:s?`\x1BOB`:`\x1B[B`;if(o===`ArrowRight`)return n?`\x1B[1;3C`:r?`\x1B[1;5C`:s?`\x1BOC`:`\x1B[C`;if(o===`ArrowLeft`)return n?`\x1B[1;3D`:r?`\x1B[1;5D`:s?`\x1BOD`:`\x1B[D`;if(o===`Home`)return s?`\x1BOH`:`\x1B[H`;if(o===`End`)return s?`\x1BOF`:`\x1B[F`;if(o===`Delete`)return`\x1B[3~`;if(o===`Insert`)return`\x1B[2~`;if(o===`PageUp`)return`\x1B[5~`;if(o===`PageDown`)return`\x1B[6~`;if(o===`Enter`)return`\r`;if(o===`Backspace`)return n?`\x1B`:``;if(o===`Tab`)return i?`\x1B[Z`:` `;if(o===`Escape`)return`\x1B`;let c=o.match(/^F(\d{1,2})$/);if(c)return{1:`\x1BOP`,2:`\x1BOQ`,3:`\x1BOR`,4:`\x1BOS`,5:`\x1B[15~`,6:`\x1B[17~`,7:`\x1B[18~`,8:`\x1B[19~`,9:`\x1B[20~`,10:`\x1B[21~`,11:`\x1B[23~`,12:`\x1B[24~`}[Number(c[1])]||null;if(r&&o.length===1){let e=o.toUpperCase().charCodeAt(0);if(e>=64&&e<=95){let t=String.fromCharCode(e-64);return n?`\x1B`+t:t}}return o.length===1?n?`\x1B`+o:o:null}_enqueueTypeAnimation(e){this._typeQueue+=e,this._typeTimer===null&&(this._typeTimer=setInterval(()=>{if(!this._typeQueue){clearInterval(this._typeTimer),this._typeTimer=null;return}if(this._isFullScreenWrite(this._typeQueue)){this._flushTypeQueue(),this.renderer.flushRender(),this._autoScroll();return}let e=0,t=0,n=this._typeQueue.indexOf(`
76
76
  `),r=n===-1?this._typeQueue.length:n+1,i=this._typeQueue.slice(0,r);if(this._isLineRewrite(i))t=r;else for(;t<this._typeQueue.length&&e<this._animateSpeed;)if(this._typeQueue.charCodeAt(t)===27)if(t++,this._typeQueue[t]===`[`){for(t++;t<this._typeQueue.length&&this._typeQueue.charCodeAt(t)<64;)t++;t<this._typeQueue.length&&t++}else if(this._typeQueue[t]===`]`){for(t++;t<this._typeQueue.length&&this._typeQueue.charCodeAt(t)!==7;){if(this._typeQueue.charCodeAt(t)===27&&this._typeQueue[t+1]===`\\`){t+=2;break}t++}t<this._typeQueue.length&&this._typeQueue.charCodeAt(t)===7&&t++}else t<this._typeQueue.length&&t++;else t++,e++;let a=this._typeQueue.slice(t);a&&!a.includes(`
77
- `)&&this._isLineRewrite(a)&&(t=this._typeQueue.length);let o=this._typeQueue.slice(0,t);this._typeQueue=this._typeQueue.slice(t),this.parser.write(o),this.renderer.flushRender(),this._autoScroll()},10))}_setupDom(e,t=`Roboto Mono`){if(typeof document>`u`)return;let n=document.createElement(`link`);n.href=`https://fonts.googleapis.com/css?family=${encodeURIComponent(t)}:ital,wght@0,400;0,700;1,400;1,700&display=swap`,n.rel=`stylesheet`,document.head&&document.head.appendChild&&document.head.appendChild(n),this._cmdList=document.createElement(`ul`),this._cmdList.style.fontFamily=`'${t}', monospace`,this._cmdList.style.listStyle=`none`,this._cmdList.style.padding=`0`,this._cmdList.style.margin=`0`,this._lineWrap&&this._cmdList.classList.add(`terminal--wrap`),e.appendChild(this._cmdList),this._charMeasure=document.createElement(`span`),this._charMeasure.className=`terminal__char-measure`,this._charMeasure.style.fontFamily=`'${t}', monospace`,this._charMeasure.textContent=`X`,this._charMeasure.setAttribute(`aria-hidden`,`true`),e.appendChild(this._charMeasure),setTimeout(()=>this._measureAndSetSize(),0),document.fonts&&document.fonts.ready&&document.fonts.ready.then(()=>this._measureAndSetSize()),typeof ResizeObserver<`u`&&new ResizeObserver(()=>this._measureAndSetSize()).observe(e)}_listenForEvents(){if(!(typeof window>`u`)&&(this._onKeyDown=e=>{if(e.metaKey)return;let t=this._encodeKey(e.key,{alt:!!e.altKey,ctrl:!!e.ctrlKey,shift:!!e.shiftKey,meta:!!e.metaKey});t&&(e.preventDefault&&e.preventDefault(),this._emitInput(t))},this._onPaste=e=>{let t=e.clipboardData||typeof window<`u`&&window.clipboardData;if(!t||typeof t.getData!=`function`)return;let n=t.getData(`text`);if(!n)return;e.preventDefault&&e.preventDefault();let r=n.replace(/\r?\n/g,`\r`);this.parser.bracketedPasteMode?this._emitInput(`\x1b[200~${r}\x1b[201~`):this._emitInput(r)},window.addEventListener(`keydown`,this._onKeyDown),window.addEventListener(`paste`,this._onPaste),this._el&&typeof this._el.addEventListener==`function`)){let e=e=>{if(!this._charMeasure||!this._el.getBoundingClientRect)return{col:1,row:1};let t=this._charMeasure.getBoundingClientRect(),n=this._el.getBoundingClientRect(),r=t.width||8,i=t.height||16;return{col:Math.max(1,Math.min(this.cols,Math.floor(((e.clientX||0)-n.left)/r)+1)),row:Math.max(1,Math.min(this.rows,Math.floor(((e.clientY||0)-n.top)/i)+1))}};this._el.addEventListener(`mousedown`,t=>{let n=t.target;if(n&&n.tagName===`A`&&(this.parser.mouseTrackingMode===0||t.metaKey||t.ctrlKey))return;let{col:r,row:i}=e(t);this.sendMouse(`mousedown`,{button:t.button||0,col:r,row:i,shift:!!t.shiftKey,alt:!!t.altKey,ctrl:!!t.ctrlKey})&&t.preventDefault&&t.preventDefault()}),this._el.addEventListener(`mouseup`,t=>{let{col:n,row:r}=e(t);this.sendMouse(`mouseup`,{button:t.button||0,col:n,row:r,shift:!!t.shiftKey,alt:!!t.altKey,ctrl:!!t.ctrlKey})&&t.preventDefault&&t.preventDefault()}),this._el.addEventListener(`mousemove`,t=>{if(this.parser.mouseTrackingMode===0)return;let{col:n,row:r}=e(t);this.sendMouse(`mousemove`,{button:t.button||0,col:n,row:r,shift:!!t.shiftKey,alt:!!t.altKey,ctrl:!!t.ctrlKey})}),this._el.addEventListener(`wheel`,t=>{let{col:n,row:r}=e(t);this.sendMouse(`wheel`,{col:n,row:r,deltaY:t.deltaY||0,shift:!!t.shiftKey,alt:!!t.altKey,ctrl:!!t.ctrlKey})&&t.preventDefault&&t.preventDefault()})}}_mobileInput(){if(typeof document>`u`||!this._el)return;let e=document.createElement(`input`);e.type=`text`,e.style.position=`fixed`,e.style.top=`0`,e.style.left=`0`,e.style.width=`0`,e.style.height=`0`,e.style.opacity=`0`,e.style.pointerEvents=`none`,e.style.zIndex=`-1`,e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`tabindex`,`-1`),e.setAttribute(`autocapitalize`,`none`),e.setAttribute(`autocorrect`,`off`),e.setAttribute(`autocomplete`,`off`),e.setAttribute(`spellcheck`,`false`),e.setAttribute(`enterkeyhint`,`go`),this._el.appendChild(e),this._mobileInputElement=e,this._mobileInputBuffer=``,this._onMobileInputClick=t=>{if(!(t&&t.target&&t.target.tagName===`A`)&&typeof e.focus==`function`&&(e.focus({preventScroll:!0}),typeof e.setSelectionRange==`function`)){let t=(e.value||``).length;e.setSelectionRange(t,t)}},this._el.addEventListener(`click`,this._onMobileInputClick);let t=()=>{let t=this._mobileInputBuffer||``,n=e.value||``;if(t===n)return;let r=0;for(;r<t.length&&r<n.length&&t[r]===n[r];)r++;let i=0;for(;i<t.length-r&&i<n.length-r&&t[t.length-1-i]===n[n.length-1-i];)i++;let a=t.length-r-i,o=n.slice(r,n.length-i);if(a>0)for(let e=0;e<a;e++)this.sendKey(`Backspace`);if(o){let e=o.replace(/\r?\n/g,`\r`);this._emitInput(e)}this._mobileInputBuffer=n};e.addEventListener(`input`,n=>{if(!n){t();return}let r=n.inputType;if(r===`insertLineBreak`||r===`insertParagraph`){this.sendKey(`Enter`),e.value=``,this._mobileInputBuffer=``;return}if(r===`deleteContentBackward`){this.sendKey(`Backspace`),this._mobileInputBuffer=e.value||``;return}if(r===`deleteContentForward`){this.sendKey(`Delete`),this._mobileInputBuffer=e.value||``;return}if(r===`deleteWordBackward`){this.sendKey(`Backspace`,{alt:!0}),this._mobileInputBuffer=e.value||``;return}if(r===`insertText`&&typeof n.data==`string`&&n.data.length>0){let t=(this._mobileInputBuffer||``).length+n.data.length;if(!e.value||e.value.length===t){let t=n.data.replace(/\r?\n/g,`\r`);this._emitInput(t),this._mobileInputBuffer=e.value||``;return}}t()}),e.addEventListener(`keydown`,t=>{t&&(t.key===`Enter`||t.keyCode===13)&&(t.defaultPrevented||(this.sendKey(`Enter`),e.value=``,this._mobileInputBuffer=``,t.preventDefault&&t.preventDefault()))}),e.addEventListener(`keyup`,e=>{e&&e.key===`Unidentified`&&t()}),e.addEventListener(`compositionend`,()=>{t()})}_autoScroll(){!this._el||typeof this._el.scrollTo!=`function`||this._el.scrollTop+this._el.offsetHeight>=this._el.scrollHeight-50&&this._el.scrollTo(0,this._el.scrollHeight)}_measureAndSetSize(){if(!this._charMeasure||!this._el||typeof this._el.getBoundingClientRect!=`function`)return;let e=this._charMeasure.getBoundingClientRect(),t=this._el.getBoundingClientRect();if(!e||!t||!e.width||!e.height||!t.width||e.width>=t.width&&e.height>=t.height)return;let n=Math.max(1,Math.floor(t.width/e.width)),r=Math.max(1,Math.floor((t.height||e.height*24)/e.height));(n!==this._lastCols||r!==this._lastRows)&&this.resize(n,r)}destroy(){this._typeTimer!==null&&(clearInterval(this._typeTimer),this._typeTimer=null),typeof window<`u`&&window.removeEventListener&&(this._onKeyDown&&window.removeEventListener(`keydown`,this._onKeyDown),this._onPaste&&window.removeEventListener(`paste`,this._onPaste)),this._mobileInputElement&&=(this._onMobileInputClick&&this._el&&typeof this._el.removeEventListener==`function`&&this._el.removeEventListener(`click`,this._onMobileInputClick),this._mobileInputElement.parentNode?this._mobileInputElement.parentNode.removeChild(this._mobileInputElement):typeof this._mobileInputElement.remove==`function`&&this._mobileInputElement.remove(),null),this._dataListeners=[],this._resizeListeners=[],this._titleListeners=[]}};I.Terminal=I,I.spawnPty=N,typeof globalThis<`u`&&(globalThis.Terminal=I),module.exports=I;
77
+ `)&&this._isLineRewrite(a)&&(t=this._typeQueue.length);let o=this._typeQueue.slice(0,t);this._typeQueue=this._typeQueue.slice(t),this.parser.write(o),this.renderer.flushRender(),this._autoScroll()},10))}_setupDom(e,t=`Roboto Mono`){if(typeof document>`u`)return;let n=document.createElement(`link`);n.href=`https://fonts.googleapis.com/css?family=${encodeURIComponent(t)}:ital,wght@0,400;0,700;1,400;1,700&display=swap`,n.rel=`stylesheet`,document.head&&document.head.appendChild&&document.head.appendChild(n),this._cmdList=document.createElement(`ul`),this._cmdList.style.fontFamily=`'${t}', monospace`,this._cmdList.style.listStyle=`none`,this._cmdList.style.padding=`0`,this._cmdList.style.margin=`0`,this._cmdList.style.lineHeight=`1.15em`,this._lineWrap&&this._cmdList.classList.add(`terminal--wrap`),e.appendChild(this._cmdList),this._charMeasure=document.createElement(`span`),this._charMeasure.className=`terminal__char-measure`,this._charMeasure.style.fontFamily=`'${t}', monospace`,this._charMeasure.style.position=`absolute`,this._charMeasure.style.top=`0`,this._charMeasure.style.left=`0`,this._charMeasure.style.visibility=`hidden`,this._charMeasure.style.pointerEvents=`none`,this._charMeasure.style.whiteSpace=`pre`,this._charMeasure.style.lineHeight=`1.15em`,this._charMeasure.textContent=`X`,this._charMeasure.setAttribute(`aria-hidden`,`true`),e.appendChild(this._charMeasure),setTimeout(()=>this._measureAndSetSize(),0),document.fonts&&document.fonts.ready&&document.fonts.ready.then(()=>this._measureAndSetSize()),typeof ResizeObserver<`u`&&(this._resizeObserver=new ResizeObserver(()=>this._measureAndSetSize()),this._resizeObserver.observe(e))}_listenForEvents(){if(!(typeof window>`u`)&&(this._onWindowResize=()=>this._measureAndSetSize(),window.addEventListener(`resize`,this._onWindowResize),this._onKeyDown=e=>{if(!e||e.defaultPrevented||e.isComposing||e.keyCode===229||e.metaKey)return;let t=this._encodeKey(e.key,{alt:!!e.altKey,ctrl:!!e.ctrlKey,shift:!!e.shiftKey,meta:!!e.metaKey});t&&(e.preventDefault&&e.preventDefault(),this._emitInput(t))},this._onPaste=e=>{let t=e.clipboardData||typeof window<`u`&&window.clipboardData;if(!t||typeof t.getData!=`function`)return;let n=t.getData(`text`);if(!n)return;e.preventDefault&&e.preventDefault();let r=n.replace(/\r?\n/g,`\r`);this.parser.bracketedPasteMode?this._emitInput(`\x1b[200~${r}\x1b[201~`):this._emitInput(r)},window.addEventListener(`keydown`,this._onKeyDown),window.addEventListener(`paste`,this._onPaste),this._el&&typeof this._el.addEventListener==`function`)){let e=e=>{if(!this._charMeasure||!this._el.getBoundingClientRect)return{col:1,row:1};let t=this._charMeasure.getBoundingClientRect(),n=this._el.getBoundingClientRect(),r=t.width||8,i=t.height||16;return{col:Math.max(1,Math.min(this.cols,Math.floor(((e.clientX||0)-n.left)/r)+1)),row:Math.max(1,Math.min(this.rows,Math.floor(((e.clientY||0)-n.top)/i)+1))}};this._el.addEventListener(`mousedown`,t=>{let n=t.target;if(n&&n.tagName===`A`&&(this.parser.mouseTrackingMode===0||t.metaKey||t.ctrlKey))return;let{col:r,row:i}=e(t);this.sendMouse(`mousedown`,{button:t.button||0,col:r,row:i,shift:!!t.shiftKey,alt:!!t.altKey,ctrl:!!t.ctrlKey})&&t.preventDefault&&t.preventDefault()}),this._el.addEventListener(`mouseup`,t=>{let{col:n,row:r}=e(t);this.sendMouse(`mouseup`,{button:t.button||0,col:n,row:r,shift:!!t.shiftKey,alt:!!t.altKey,ctrl:!!t.ctrlKey})&&t.preventDefault&&t.preventDefault()}),this._el.addEventListener(`mousemove`,t=>{if(this.parser.mouseTrackingMode===0)return;let{col:n,row:r}=e(t);this.sendMouse(`mousemove`,{button:t.button||0,col:n,row:r,shift:!!t.shiftKey,alt:!!t.altKey,ctrl:!!t.ctrlKey})}),this._el.addEventListener(`wheel`,t=>{let{col:n,row:r}=e(t);this.sendMouse(`wheel`,{col:n,row:r,deltaY:t.deltaY||0,shift:!!t.shiftKey,alt:!!t.altKey,ctrl:!!t.ctrlKey})&&t.preventDefault&&t.preventDefault()})}}_mobileInput(){if(typeof document>`u`||!this._el)return;let e=document.createElement(`input`);e.type=`text`,e.style.position=`fixed`,e.style.top=`0`,e.style.left=`0`,e.style.width=`0`,e.style.height=`0`,e.style.opacity=`0`,e.style.pointerEvents=`none`,e.style.zIndex=`-1`,e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`tabindex`,`-1`),e.setAttribute(`autocapitalize`,`none`),e.setAttribute(`autocorrect`,`off`),e.setAttribute(`autocomplete`,`off`),e.setAttribute(`spellcheck`,`false`),e.setAttribute(`enterkeyhint`,`go`),this._el.appendChild(e),this._mobileInputElement=e,this._mobileInputBuffer=``,this._onMobileInputClick=t=>{if(!(t&&t.target&&t.target.tagName===`A`)&&typeof e.focus==`function`&&(e.focus({preventScroll:!0}),typeof e.setSelectionRange==`function`)){let t=(e.value||``).length;e.setSelectionRange(t,t)}},this._el.addEventListener(`click`,this._onMobileInputClick);let t=()=>{let t=this._mobileInputBuffer||``,n=e.value||``;if(t===n)return;let r=0;for(;r<t.length&&r<n.length&&t[r]===n[r];)r++;let i=0;for(;i<t.length-r&&i<n.length-r&&t[t.length-1-i]===n[n.length-1-i];)i++;let a=t.length-r-i,o=n.slice(r,n.length-i);if(a>0)for(let e=0;e<a;e++)this.sendKey(`Backspace`);if(o){let e=o.replace(/\r?\n/g,`\r`);this._emitInput(e)}this._mobileInputBuffer=n};e.addEventListener(`input`,n=>{if(!n){t();return}let r=n.inputType;if(r===`insertLineBreak`||r===`insertParagraph`){this.sendKey(`Enter`),e.value=``,this._mobileInputBuffer=``;return}if(r===`deleteContentBackward`){this.sendKey(`Backspace`),this._mobileInputBuffer=e.value||``;return}if(r===`deleteContentForward`){this.sendKey(`Delete`),this._mobileInputBuffer=e.value||``;return}if(r===`deleteWordBackward`){this.sendKey(`Backspace`,{alt:!0}),this._mobileInputBuffer=e.value||``;return}if(r===`insertText`&&typeof n.data==`string`&&n.data.length>0){let t=(this._mobileInputBuffer||``).length+n.data.length;if(!e.value||e.value.length===t){let t=n.data.replace(/\r?\n/g,`\r`);this._emitInput(t),this._mobileInputBuffer=e.value||``;return}}t()}),e.addEventListener(`keydown`,t=>{t&&(t.key===`Enter`||t.keyCode===13)&&(t.defaultPrevented||(this.sendKey(`Enter`),e.value=``,this._mobileInputBuffer=``,t.preventDefault&&t.preventDefault()))}),e.addEventListener(`keyup`,e=>{e&&e.key===`Unidentified`&&t()}),e.addEventListener(`compositionend`,()=>{t()})}_autoScroll(){!this._el||typeof this._el.scrollTo!=`function`||this._el.scrollTop+this._el.offsetHeight>=this._el.scrollHeight-50&&this._el.scrollTo(0,this._el.scrollHeight)}_measureAndSetSize(){if(!this._charMeasure||!this._el||typeof this._el.getBoundingClientRect!=`function`)return;let e=this._charMeasure.getBoundingClientRect(),t=this._el.getBoundingClientRect();if(!e||!t||!e.width||!e.height||!t.width||e.width>=t.width&&e.height>=t.height)return;let n=typeof this._el.clientWidth==`number`&&this._el.clientWidth>0?this._el.clientWidth:t.width,r=typeof this._el.clientHeight==`number`&&this._el.clientHeight>0?this._el.clientHeight:t.height||e.height*24;if(typeof window<`u`&&typeof window.getComputedStyle==`function`)try{let e=window.getComputedStyle(this._el);if(e){let t=(parseFloat(e.paddingLeft)||0)+(parseFloat(e.paddingRight)||0),i=(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0);n>t&&(n-=t),r>i&&(r-=i)}}catch{}let i=Math.max(1,Math.floor(n/e.width)),a=Math.max(1,Math.floor(r/e.height));(i!==this._lastCols||a!==this._lastRows)&&this.resize(i,a)}destroy(){this._typeTimer!==null&&(clearInterval(this._typeTimer),this._typeTimer=null),this._resizeObserver&&typeof this._resizeObserver.disconnect==`function`&&(this._resizeObserver.disconnect(),this._resizeObserver=null),typeof window<`u`&&window.removeEventListener&&(this._onWindowResize&&window.removeEventListener(`resize`,this._onWindowResize),this._onKeyDown&&window.removeEventListener(`keydown`,this._onKeyDown),this._onPaste&&window.removeEventListener(`paste`,this._onPaste)),this._mobileInputElement&&=(this._onMobileInputClick&&this._el&&typeof this._el.removeEventListener==`function`&&this._el.removeEventListener(`click`,this._onMobileInputClick),this._mobileInputElement.parentNode?this._mobileInputElement.parentNode.removeChild(this._mobileInputElement):typeof this._mobileInputElement.remove==`function`&&this._mobileInputElement.remove(),null),this._dataListeners=[],this._resizeListeners=[],this._titleListeners=[]}};I.Terminal=I,I.spawnPty=N,typeof globalThis<`u`&&(globalThis.Terminal=I),module.exports=I;
78
78
  //# sourceMappingURL=terminal.cjs.js.map